|
called in the context of a distinct thread to notify clients when data should be visualized
OnVisualizeExecute() is called in the context of a distnct thread at the moment the audio device actually plays the first sample of a sample set previously passed in to OnVisualizePrepare(). The sample set the notification applies to is the set that had the same sequence number and timestamp as those passed in. In addition, the state of buffer fullness is given in terms of the number of buffers filled and queued in the driver out of a number of total buffers in the driver chain. So if nBuffersQueued == 4, and nTotalBuffers == 8, then the driver has 50% buffer fullness.
You should perform the actual visualization of the data you previously prepared, either in the context of this distinct thread, or by signalling your own thread to do so.
- Parameters:
-
| nStreamUniqueID | the unique stream ID of the sample set the notification applies to |
| nTimestampMilliseconds | the timestamp of the sample set the notification applies to |
| nBuffersQueued | the current number of buffers in the driver chain queued |
| nTotalBuffers | the total number of buffers in the driver chain |
- Note:
- Like OnVisualizePrepare(), any processing you do in this function will add delay to the decoding cycle. If too much delay is introduced, the audio device will underflow with data.
It is possible that more than one driver buffer will have played between invocations of this function (because decoding took longer than 1 buffer took to play). In this event, you will only be called back with the most recently started timestamp, i.e. notifications can be lost.
|