Add option to mute audio on minimize and background gamepad input

Fixes #461
This commit is contained in:
Cameron Gutman
2020-12-25 15:32:11 -06:00
parent f7ffb30bc6
commit a11f623b17
8 changed files with 74 additions and 6 deletions

View File

@@ -197,6 +197,11 @@ void Session::arDecodeAndPlaySample(char* sampleData, int sampleLength)
s_ActiveSession->m_AudioSampleCount++;
// If audio is muted, don't decode or play the audio
if (s_ActiveSession->m_AudioMuted) {
return;
}
if (s_ActiveSession->m_AudioRenderer != nullptr) {
int desiredSize = sizeof(short) * s_ActiveSession->m_AudioConfig.samplesPerFrame * s_ActiveSession->m_AudioConfig.channelCount;
void* buffer = s_ActiveSession->m_AudioRenderer->getAudioBuffer(&desiredSize);