Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

Microsoft Speech Platform

SPAUDIOBUFFERINFO

SPAUDIOBUFFERINFO

Real-time audio objects (for example, 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 (for example, buffer size, event latency, or other elements)

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>typedef struct SPAUDIOBUFFERINFO { ULONG </strong> <em>ulMsMinNotification</em>; <strong>ULONG</strong> <em>ulMsBufferSize</em>; <strong>ULONG</strong> <em>ulMsEventBias</em>; <strong>} SPAUDIOBUFFERINFO</strong>; </pre>

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.