Copyright © 2005-2011 MultiMedia Soft

StreamQueuePushData method

Return to chapter overview

Remarks

 

Pushes uncompressed PCM data taken from a memory stream into a sound stream previously created through the StreamQueueCreate method. When feeding PCM data into a stream in playback, this method should be called at a rate sufficient to sustain playback without glitches: if for any reason the control shouldn't receive enough PCM data, it would be forced to stall playback and to fire a StreamQueueStalled event; when enough PCM data should be available again, the SoundPlaying event would be fired automatically.

 

When version 3.0 or higher of the .NET framework is available, this method and the StreamQueueCreate method can be used in conjunction with the System.Speech.Synthesis.SpeechSynthesizer class in order to provide a mean for redirecting the output or applying special effect and visual feedbacks to the output of the System.Speech.Synthesis.SpeechSynthesizer.SetOutputToAudioStream method. See the How to integrate Microsoft's Speech API tutorial for details.

 

 

Syntax

 

[Visual Basic]

Public Function StreamQueuePushData (

nPlayerIndex as Int16,

ms as MemoryStream

) as enumErrorCodes


 

[C#]

public enumErrorCodes StreamQueuePushData (

Int16 nPlayerIndex,

MemoryStream ms

);


 

[C++]

public: enumErrorCodes StreamQueuePushData (

Int16 nPlayerIndex,

MemoryStream ms

);


 

 

Parameter

Description

 

 

nPlayerIndex

Number representing the zero-based index of the player that will load the memory sound

ms

Memory stream containing uncompressed PCM data to push into the queue

 

 

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.