summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2012-12-24 12:58:15 +1300
committerMatthew Parlane <parlane@gmail.com>2012-12-24 12:58:15 +1300
commitf6418bd09357a528bc495f6854512586d76f28c6 (patch)
treece7748e276363190022f766f4e2d3664712f7c58 /Source/Core/AudioCommon
parentd9dd94ac8b696ceb0e6b32eaafcc302b41f43bd1 (diff)
parenteedca572702c7416805375bd652c56af8665d167 (diff)
Merge branch 'master' into wii-usb
Diffstat (limited to 'Source/Core/AudioCommon')
-rw-r--r--Source/Core/AudioCommon/Src/CoreAudioSoundStream.cpp8
-rw-r--r--Source/Core/AudioCommon/Src/CoreAudioSoundStream.h1
-rw-r--r--Source/Core/AudioCommon/Src/OpenALStream.cpp3
3 files changed, 10 insertions, 2 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,
diff --git a/Source/Core/AudioCommon/Src/CoreAudioSoundStream.h b/Source/Core/AudioCommon/Src/CoreAudioSoundStream.h
index b7f7d96f53..581e4aabd8 100644
--- a/Source/Core/AudioCommon/Src/CoreAudioSoundStream.h
+++ b/Source/Core/AudioCommon/Src/CoreAudioSoundStream.h
@@ -47,6 +47,7 @@ public:
private:
AudioUnit audioUnit;
+ int m_volume;
static OSStatus callback(void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
diff --git a/Source/Core/AudioCommon/Src/OpenALStream.cpp b/Source/Core/AudioCommon/Src/OpenALStream.cpp
index 99220f0ed2..2abd357782 100644
--- a/Source/Core/AudioCommon/Src/OpenALStream.cpp
+++ b/Source/Core/AudioCommon/Src/OpenALStream.cpp
@@ -123,7 +123,6 @@ void OpenALStream::SoundLoop()
{
Common::SetCurrentThreadName("Audio thread - openal");
- ALenum err;
u32 ulFrequency = m_mixer->GetSampleRate();
memset(uiBuffers, 0, OAL_NUM_BUFFERS * sizeof(ALuint));
@@ -144,8 +143,8 @@ void OpenALStream::SoundLoop()
// Set the default sound volume as saved in the config file.
alSourcef(uiSource, AL_GAIN, fVolume);
- err = alGetError();
// TODO: Error handling
+ //ALenum err = alGetError();
ALint iBuffersFilled = 0;
ALint iBuffersProcessed = 0;