I have a basic audio playback setup (play a wave file, more or less) and I'd like to be able to mute the output device but still have it continue sampling the source file, so when the user unmutes it will start playing where it is currently sampling from (not from where it was muted). How best can I accomplish this?
Here's basic init code...
this->audioDeviceManager = new AudioDeviceManager(); this->audioDeviceManager->initialiseWithDefaultDevices (0, 2); this->myAudioSource = new MyAudioSource(computedQueueSize); this->resampledSource = new ResamplingAudioSource(this->myAudioSource, false); this->resampledSource->setResamplingRatio(sourceSampleingRate / outputSourceSampleingRate); this->audioSourcePlayer.setSource (this->resampledSource); // give the device manager our player this->audioDeviceManager->addAudioCallback(&this->audioSourcePlayer);
Does audioDeviceManager->getCurrentAudioDevice()->stop() accomplish what I need? The docs read like it will stop sampling. Or do I need to implement a "save the current output levels" , "set levels to 0" method to accomplish my 'mute/unmute' implementation?