The sio_stop() function puts the audio subsystem in the same state as before sio_start() is called. It stops recording, drains the play buffer and then
stops playback. If samples to play are queued but playback hasn't started yet then playback is forced immediately; playback will actually stop once the
buffer is drained. In no case are samples in the play buffer discarded.
Therefore, sio_stop() performs all of the necessary draining for us.
*/
if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) {