Commit c4f69699 authored by David Reid's avatar David Reid

Add some documentation for the data callback.

This clarifies that frameCount won't necessarily be exactly what the
client asked for when initializing the device.
parent 3567e930
...@@ -1770,7 +1770,9 @@ pInput is a pointer to a buffer containing input data from the device. This will ...@@ -1770,7 +1770,9 @@ pInput is a pointer to a buffer containing input data from the device. This will
null for a playback device. null for a playback device.
frameCount is the number of PCM frames to process. If an output buffer is provided (pOutput is not null), applications should write out frameCount is the number of PCM frames to process. If an output buffer is provided (pOutput is not null), applications should write out
to the entire output buffer. to the entire output buffer. Note that frameCount will not necessarily be exactly what you asked for when you initialized the deviced.
The bufferSizeInFrames and bufferSizeInMilliseconds members of the device config are just hints, and are not necessarily exactly what
you'll get.
Do _not_ call any miniaudio APIs from the callback. Attempting the stop the device can result in a deadlock. The proper way to stop the Do _not_ call any miniaudio APIs from the callback. Attempting the stop the device can result in a deadlock. The proper way to stop the
device is to call ma_device_stop() from a different thread, normally the main application thread. device is to call ma_device_stop() from a different thread, normally the main application thread.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment