SoundComposer.ItemSpeechFromFileAdd method |
|
Remarks
Adds a speech item, obtained from a text file, to the audio stream previously created through the SoundComposer.SessionCreate method. In case you should need to add a text to speech stream from a simple string of text you may use the SoundComposer.ItemSpeechFromStringAdd method.
The text file 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 SoundComposerMan class and the How to compose a sound tutorial.
Syntax
[Visual Basic] Public Function ItemSpeechFromFileAdd ( nPlayerIndex as Int16, strFriendlyName as String, nChannel as Int16, strPathname as String, nVoice as Int32, bRemoveFinalSilence as bool, nOffsetMs as Int32, ByRef nUniqueId as Int32 ) as enumErrorCodes |
[C#] public enumErrorCodes ItemSpeechFromFileAdd ( Int16 nPlayerIndex, string strFriendlyName, Int16 nChannel, string strPathname, Int32 nVoice, bool bRemoveFinalSilence, Int32 nOffsetMs, ref Int32 nUniqueId ); |
[C++] public: enumErrorCodes ItemSpeechFromFileAdd ( Int16 nPlayerIndex, string strFriendlyName, Int16 nChannel, string strPathname, Int32 nVoice, bool bRemoveFinalSilence, Int32 nOffsetMs, Int32 __gc *nUniqueId ); |
Parameter |
Description |
||||||
|
|
||||||
nPlayerIndex |
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. |
||||||
strPathname |
Absolute pathname of the text file |
||||||
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:
|
||||||
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. |