Microsoft Speech Platform
SPAUDIOBUFFERINFO
SPAUDIOBUFFERINFO contains the audio stream buffer information.Real-time audio objects (e.g., ISpMMSysAudio or a custom ISpAudio-based audio object) should use a buffer to allow for latency in the audio stream, either during reads or writes. The SPAUDIOBUFFERINFO structure contains elements that define how the buffer should be used at run time (e.g., buffer size, event latency, etc.)
typedef struct SPAUDIOBUFFERINFO
{
ULONG ulMsMinNotification;
ULONG ulMsBufferSize;
ULONG ulMsEventBias;
} SPAUDIOBUFFERINFO;
Members
- ulMsMinNotification
- The minimum preferred time, in milliseconds, between the actual time an event notification occurs and the ideal time. More CPU resources are needed when the amount of time is shorter; however, the event notifications are more timely. This value must be greater than zero and no more than one quarter the size of the ulMsBuffersize.
A reasonable default is 50ms. - ulMsBufferSize
- The size of the audio object's buffer, in milliseconds. For readable audio objects, this is simply a preferred size; readable objects will automatically expand their buffers to accommodate data. For writable audio objects, this is the amount of audio data that will be buffered before a call to Write will block. This value must be greater than or equal to 200 milliseconds.
A reasonable default is 500ms. - ulMsEventBias
- The amount of time, in milliseconds, by which event notifications precede the actual occurrence of the events. For example, setting a value of 100 for the event bias would cause all events to be notified 100 milliseconds prior to the audio data being played. This can be useful for applications needing time to animate mouths for TTS voices. This value cannot be larger than ulMsBufferSize.
A reasonable default is 0ms; applications should set ulMsEventBias based on specific circumstances.