diff options
Diffstat (limited to 'engines/dm/sounds.cpp')
-rw-r--r-- | engines/dm/sounds.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/dm/sounds.cpp b/engines/dm/sounds.cpp index 681ff6da22..cdbed462a3 100644 --- a/engines/dm/sounds.cpp +++ b/engines/dm/sounds.cpp @@ -30,6 +30,7 @@ #include "dm.h" #include "gfx.h" +#include <audio/mixer.h> namespace DM { @@ -96,4 +97,15 @@ void DMEngine::f503_loadSounds() { } } +void DMEngine::f060_SOUND_Play(uint16 soundIndex, uint16 period, uint8 leftVolume, uint8 rightVolume) { + byte soundFlags = Audio::FLAG_STEREO; + SoundData *sound = &_gK24_soundData[soundIndex]; + Audio::AudioStream *stream = Audio::makeRawStream(sound->_firstSample, sound->_byteCount, 72800 / period, soundFlags, DisposeAfterUse::NO); + + signed char balance = ((int16)rightVolume - (int16)leftVolume) / 2; + + Audio::SoundHandle handle; + _mixer->playStream(Audio::Mixer::kSFXSoundType, &handle, stream, - 1, 127, balance); +} + } |