I think SDL_PauseAudioDevice() can not achieve this purpose.
Even if the play is paused, SDL will still call AudioQueueEnqueueBuffer,
just to set desired data to 0.
By the way, I implemented to "Pause" based on AudioQueue. Below is code.
-----------------------------------
static void COREAUDIO_PauseDevice(_THIS, int pause_on)
{
if (pause_on) {
AudioQueueStop(this->hidden->audioQueue, 1);
} else {
OSStatus result = AudioQueueStart(this->hidden->audioQueue,
NULL);
}
}
-----Original Message-----
From: SDL [mailto:sdl-***@lists.libsdl.org] On Behalf Of Ryan C. Gordon
Sent: Sunday, November 27, 2016 1:20 PM
To: SDL Development List <***@lists.libsdl.org>
Subject: Re: [SDL] (iOS)Why use AudioQueue instead of AudioUnit
Post by leagorIn previous version that using AudioUnit, I call AudioOutputUnitStop
when no sound require to play. When requiring, call
AudioOutputUnitStart. This method can avoid extra power consumption.
Is SDL_PauseAudioDevice() not an option?
Talking directly to system APIs for stuff SDL is handling for you tends to
be dangerous, for just this reason.
--ryan.