Using Sapi Visual Basic Programs Microsoft

Posted by admin
Using Sapi Visual Basic Programs Microsoft 3,6/5 6862 reviews
  1. Microsoft Visual Basic
  2. Microsoft Sapi 5.4 Download
  • Visual Basic is engineered for productively building type-safe and object-oriented applications. Visual Basic enables developers to target Windows, Web, and mobile devices. As with all languages targeting the Microsoft.NET Framework, programs written in Visual Basic benefit from security and language interoperability.
  • Voice Recognition System. Hi, Actually SAPI (Speech API) is not a Software. It is a SDK (Software Development Kit). It Consists of so many Activex controls, Libraries, Documentation,Samples about to develop the Speech related Softwares. Better to use SAPI, it will reduce your more work such as Getting the Input from the Microphone.

NET SAPI SDK. This marks the evolution of Microsoft's long dominant position in speech technology, and signals that Microsoft is committed to providing speech technology interfaces for its programming environments for the forseeable future.

-->

Microsoft Speech API 5.3

The SpVoice object brings the text-to-speech (TTS) engine capabilities to applications using SAPI automation. An application can create numerous SpVoice objects, each independent of and capable of interacting with the others. An SpVoice object, usually referred to simply as a voice, is created with default property settings so that it is ready to speak immediately.

Voice Characteristics and UI Support

The fundamental characteristics of the voice are the Voice property, which can be thought of as the person of the voice, the Rate property, and the Volume property. 'Microsoft Mary' and 'Microsoft Mike' are examples of Voices. Use the GetVoices method to determine what other voices are available to the voice object.

These properties can be modified with a User Interface (UI). The IsUISupported method determines if a specific UI is supported. Use the DisplayUI method to display a supported UI. The TTS tab of Speech properties in Control Panel, which enables users to modify the characteristics of the default system voice, is an example of a voice UI.

Speaking and Queueing

The Speak method places a text stream in the TTS engine's input queue and returns a stream number. It can be called synchronously or asynchronously. When called synchronously, the Speak method does not return until the text has been spoken; when called asynchronously, it returns immediately, and the voice speaks as a background process.

When synchronous speech is used in an application, the application's execution is blocked while the voice speaks, and the user is effectively locked out. This may be acceptable for simple applications, or those with no graphical user interface (GUI), but when sophisticated user interaction is intended, asynchronous speaking will generally be more appropriate.

Asynchronous speaking can place numerous text streams into the input queue. These streams are also referred to as speech requests. The stream number returned by an asynchronous Speak call is the stream's index in the voice queue. The WaitUntilDone method blocks execution until the voice finishes speaking, enabling an application to speak a text stream asynchronously and determine when it finishes. The hidden SpeakCompleteEvent method is similar to WaitUntilDone, except that it returns an event handle for the background speaking process, and does not block application execution.

The SpeakStream method operates like the Speak method, except that it speaks sound files instead of text.

Sapi

Voice Output

An SpVoice object is created with its audio output set to the system default audio output. Use the GetAudioOutputs method to determine what other outputs are available to the voice, and use the AudioOutput property to set its audio output to one of them.

Use the AudioOutputStream property with other Speech automation objects to store audio output in memory (see SpMemoryStream) or in files (see SpFileStream).

Voice Events

As a voice speaks text, it can generate events when it detects certain conditions in the input stream. These events are contained in the SpeechVoiceEvents enumeration. Examples of these events are completion of phonemes, words, or sentences, as well as changes of voice or the presence of bookmarks. The range of conditions which can be reported by SpeechVoiceEvents is wide enough that most applications will use only a few of them. To prevent the TTS engine from generating events that will be ignored by the application, use the EventInterests property to specify the events of interest. Only these events will be raised.

The point in the input text stream at which a potential event has been completed is referred to as an event boundary. At each event boundary, the event type is compared with the current EventInterests. If the event type is of interest, an event of that type is raised. Voice events return the input stream number in order to associate them with the appropriate stream.

Voice Priorities and Alerts

Application error handling has traditionally interrupted a UI with message boxes or alert boxes describing error states. Because a TTS application might operate with no graphical UI at all, it is able to implement error handling with a TTS voice. This voice is referred to as an alert, because its purpose is identical to that of an alert box or message box. To create an alert voice, create a new SpVoice object and set its Priority property appropriately. The alert voice should also use a different Voice property from the normal voice, so that users can easily distinguish the two.

When a speaking voice detects a pending alert, it continues speaking until it arrives at a specific application-defined stopping point, such as a sentence or a word. This stopping point is called the alert boundary because it is an event boundary at which alerts can be processed. When the alert has finished speaking, the interrupted voice resumes. Get and set the alert boundary with the AlertBoundary property.

Status and Control

Microsoft Visual Basic

The Status method may return an ISpeechVoiceStatus object, which contains several types of information about the state of the voice. Some ISpeechVoiceStatus properties are equivalent to parameters returned by voice events; it may be advantageous for some applications to get these elements by calling Status occasionally, rather than by receiving events constantly.

Voice status and voice events are closely associated with the status of the audio output device. A voice speaking to a file stream produces no audio output, generates no events, and has no audio output status. As a result, the ISpeechVoiceStatus data returned by that voice will always show it to be inactive.

A speaking voice can be paused at the next alert boundary with the Pause method. A paused voice can be resumed with the Resume method. The Skip method causes the voice to skip forward or backward in the input stream.

Automation Interface Elements

The SpVoice automation object has the following elements:

Properties
AlertBoundary Property
AllowAudioOutputFormatChangesOnNextSet Property
AudioOutput Property
AudioOutputStream Property
EventInterests Property
Priority Property
Rate Property
Status Property
SynchronousSpeakTimeout Property
Voice Property
Volume Property
Methods
DisplayUI Method
GetAudioOutputs Method
GetVoices Method
IsUISupported Method
Pause Method
Resume Method
Skip Method
Speak Method
SpeakCompleteEvent Method
SpeakStream Method
WaitUntilDone Method
-->

Microsoft Speech API 5.3

Prerequisites

To run the code examples contained in this documentation, your computer must have the following installed:

  • SAPI 5.1
  • Visual Basic 5.0, Visual Basic 6.0, or Visual Basic.Net
  • Speakers

A microphone is helpful, but not necessary, for demonstrating speech recognition.

Getting Started

The code examples in this document are designed for use with Microsoft Visual Basic. Each example is identified either as a 'code snippet' or as 'form code.' Code snippets are small sections of code intended to be placed within a single Visual Basic procedure; form code examples are designed to be placed within a Visual Basic form. All forms, modules, controls and resources use Visual Basic's default names, such as form 'Form1,' command button 'Command1,' and resource '101.'

Microsoft Sapi 5.4 Download

Following are the normal steps for running a code example:

Opening a project in Visual Basic
  1. Open Visual Basic.
  2. In the New Project dialog box, double-click Standard exe.
  3. Visual Basic will display a new form called Form1.
Adding a 'code snippet' example to the project
  1. Double-click on Form1 to display the code.
  2. Select the example code from the documentation and copy (Ctl-C).
  3. Click inside the Form_Load procedure and paste (Ctl-V).
Adding a form code example to the project

If the code example uses controls, use the Toolbox to add them to Form1

  1. Double-click on Form1 to display the code.
  2. Select the example code from the documentation and copy (Ctl-C).
  3. Select all code in Form1 and paste (Ctl-V).
Adding a reference to SAPI
  1. From the Project menu, click References.
  2. In the References list box, select Microsoft Speech Object Library.
  3. Click OK.

About the Examples

Recognition of text-to-speech voices

Several of the speech recognition code examples perform recognition of audio files created by text-to-speech (TTS) voices. Speech recognition is designed to recognize human voices rather than TTS voices, so the quality of recognition from TTS voices is not as high as that from human voices; however, TTS voices are also much more consistent than human voices. Some code examples need to demonstrate types of recognition result data that are dependent on subtle factors in the speaking voice. In the instances where TTS recognition takes place, users can enter their own text. In some cases, it may be difficult to find a phrase that will produce a particular recognition result from a TTS voice. Once such a phrase is known, a TTS voice speaking that phrase will reproduce those results very consistently. Most of these types of results would be very difficult for a user to reproduce by speaking into a microphone.