Bigger
This commit is contained in:
@@ -39,6 +39,9 @@ void SoundSystem::Init()
|
||||
ma_uint32 uiSampleRate = ma_engine_get_sample_rate(&m_engine);
|
||||
Msg("Sound sampling rate: %d\n", uiSampleRate);
|
||||
|
||||
// Initialize listener
|
||||
SetListenerPosition(0.0f, 0.0f, 0.0f);
|
||||
|
||||
m_inited = true;
|
||||
}
|
||||
|
||||
@@ -91,6 +94,15 @@ void SoundSystem::Play(SoundHandle handle, bool bLoop)
|
||||
ma_sound_set_looping(&m_sounds[handle], true);
|
||||
}
|
||||
|
||||
void SoundSystem::Play3D(SoundHandle handle, float x, float y, float z, bool bLoop)
|
||||
{
|
||||
if ( !m_inited )
|
||||
return;
|
||||
|
||||
Play(handle, bLoop);
|
||||
ma_sound_set_position(&m_sounds[handle], x, y, z);
|
||||
}
|
||||
|
||||
void SoundSystem::Stop(SoundHandle handle)
|
||||
{
|
||||
if ( !m_inited )
|
||||
@@ -121,4 +133,20 @@ void SoundSystem::SetMasterVolume(float volume)
|
||||
float SoundSystem::GetMasterVolume()
|
||||
{
|
||||
return ma_engine_get_volume(&m_engine);
|
||||
}
|
||||
}
|
||||
|
||||
void SoundSystem::SetListenerPosition(float _x, float _y, float _z)
|
||||
{
|
||||
if ( !m_inited )
|
||||
return;
|
||||
|
||||
ma_engine_listener_set_position(&m_engine, 0, _x, _y, _z);
|
||||
}
|
||||
|
||||
void SoundSystem::SetListenerDirection(float _x, float _y, float _z)
|
||||
{
|
||||
if ( !m_inited )
|
||||
return;
|
||||
|
||||
ma_engine_listener_set_direction(&m_engine, 0, _x, _y, _z);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user