Copyright © 2001-2020 MultiMedia Soft

SoundComposer.ItemSpeechFromStringAdd method

Previous pageReturn to chapter overviewNext page

Remarks

 

Adds a speech item, contained inside a string, to the audio stream previously created through the SoundComposer.SessionCreate method. In case you should need to add a text to speech stream from contents of a text file you may use the SoundComposer.ItemSpeechFromFileAdd method.

 

Once added to the list of available items, the string of text can be still modified through the SoundComposer.ItemSpeechStringSet method until playback of the item starts.

 

The string of text may eventually contain XML markups: see the MSDN documentation for a tutorial about XML markup syntax.

 

For further details about sound composing see the the SoundComposer object and the How to compose a sound tutorial.

 

 

Syntax

 

[Visual Basic]

control.SoundGenerator.ItemSpeechFromStringAdd (

nPlayer as Integer,

strFriendlyName as String,

nChannel as Integer,

strTextToSpeech as String,

nVoice as Long,

bRemoveFinalSilence as enumBoolean,

nOffsetMs as Long,

ByRef nUniqueId as Long

) as enumErrorCodes


 

[C++]

short control.SoundGenerator.ItemSpeechFromStringAdd (

short nPlayer,

LPCTSTR strFriendlyName,

short nChannel,

LPCTSTR strTextToSpeech,

long nVoice,

short bRemoveFinalSilence,

long nOffsetMs,

long *nUniqueId

);


 

Parameter

Description

 

 

nPlayer

Number representing the zero-based index of the player that owns the sound composer session

strFriendlyName

Friendly name of the item

nChannel

Channel of the audio stream that will reproduce the item: can be a value between 0 and the number of channels of the audio stream created through the SoundComposer.SessionCreate method.

strTextToSpeech

String of text to speech

nVoice

Zero-based index of the speaking voice. The total number of voices installed inside the system can be obtained through the SoundGenerator.SpeechVoicesNumGet method and related attributes can be obtained through the SoundGenerator.SpeechVoiceAttributeGet method.

bRemoveFinalSilence

Boolean flag that specifies to remove the final silence usually introduced by the Speech API.

Supported values are the following:

Mnemonic Value

Meaning

false

Don't remove final silence

true

Remove final silence

nOffsetMs

Offset of the item, expressed in milliseconds, respect to the beginning of the audio stream (in case the stream should be in stopped state) or respect to the current playback position (in case the stream should be already in playback state).

nUniqueId

Reference to a value that, on return from the method call, will contain the unique identifier of the newly added element: this unique identifier will be used in order to invoke further methods related to the use of this specific element:

 

- SoundComposer.ItemSpeechStringSet to modify the string of the text to speech

- SoundComposer.ItemContentGet to obtain the current string of text to speech or the pathname of the file containing the text to speech

- SoundComposer.ItemSpeechVoiceGet to obtain the speaking voice

- SoundComposer.ItemSpeechVoiceSet to modify the speaking voice

 

- SoundComposer.ItemFriendlyNameGet to obtain the friendly name of the item

- SoundComposer.ItemFriendlyNameSet to obtain the friendly name of the item

- SoundComposer.ItemInfoGet to obtain various information about the item

- SoundComposer.ItemAmplitudeSet to modify the amplitude of the item

- SoundComposer.ItemChannelSet to modify the channel of of the audio stream that will reproduce the item

- SoundComposer.ItemRemove to remove the item from the sound composition

- SoundComposer.ItemOffsetSet to modify the offset, expressed in milliseconds, of the item respect to the beginning of the audio stream

- SoundComposer.ItemTypeGet to obtain the item's type

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred (see the LastError property for further error details)

enumErrorCodes.NOERROR (0)

The method call was successful.