From c4f69699f0149c0bda8a9f41901ca02cf137335b Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 15 Jun 2019 07:39:05 +1000 Subject: [PATCH] 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. --- miniaudio.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/miniaudio.h b/miniaudio.h index aee05d81..ecf54d59 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -1770,7 +1770,9 @@ pInput is a pointer to a buffer containing input data from the device. This will 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 -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 device is to call ma_device_stop() from a different thread, normally the main application thread.