diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2012-12-14 12:15:01 -0600 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2012-12-14 12:15:01 -0600 |
| commit | 88b890824b6691c90e0cd5828b212a65f07443e7 (patch) | |
| tree | 32ead253360f9d53bae771db35f5ad6777012972 /Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp | |
| parent | 3b559d89ec39b4479bf97aa376f7e685997db0a3 (diff) | |
(CoreAudio) Retain volume value until initialization. Makes volume slider work when game isn't running. Fixes issue 5383.
Diffstat (limited to 'Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp b/Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp index d09bce85f9..f6d5d31bed 100644 --- a/Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp +++ b/Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp @@ -87,6 +87,13 @@ bool CoreAudioSound::Start() return false; } + err = AudioUnitSetParameter(audioUnit, + kHALOutputParam_Volume, + kAudioUnitParameterFlag_Output, 0, + m_volume / 100., 0); + if (err != noErr) + ERROR_LOG(AUDIO, "error setting volume"); + err = AudioUnitInitialize(audioUnit); if (err != noErr) { ERROR_LOG(AUDIO, "error initializing audiounit"); @@ -105,6 +112,7 @@ bool CoreAudioSound::Start() void CoreAudioSound::SetVolume(int volume) { OSStatus err; + m_volume = volume; err = AudioUnitSetParameter(audioUnit, kHALOutputParam_Volume, |
