diff options
author | Torbjörn Andersson | 2004-05-17 16:11:04 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2004-05-17 16:11:04 +0000 |
commit | 9ec42ab9a7d79cc392a48283d205fa2d24c8cb1d (patch) | |
tree | 48731ef09cf8d7e8b914cba51c412ce14e76c128 /saga/sound.cpp | |
parent | c51d9fba0859c735a65b4fa505acdd0fbbffa617 (diff) | |
download | scummvm-rg350-9ec42ab9a7d79cc392a48283d205fa2d24c8cb1d.tar.gz scummvm-rg350-9ec42ab9a7d79cc392a48283d205fa2d24c8cb1d.tar.bz2 scummvm-rg350-9ec42ab9a7d79cc392a48283d205fa2d24c8cb1d.zip |
Added support for using the separate VOC file (P2_A.VOC) from the Wyrmkeep
release of ITE. The code is a bit rough, and there's a nasty 'pop' at the
beginning of the sound (and a smaller one at the end), but it's a start.
It's a shame that the sound is of such low quality: lower sample rate, and
8 bits instead of 16. Perhaps it was extracted from the floppy version?
svn-id: r13840
Diffstat (limited to 'saga/sound.cpp')
-rw-r--r-- | saga/sound.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/saga/sound.cpp b/saga/sound.cpp index 65797b92d9..4995a7d007 100644 --- a/saga/sound.cpp +++ b/saga/sound.cpp @@ -106,18 +106,33 @@ int Sound::stop(int channel) { int Sound::playVoice(R_SOUNDBUFFER *buf) { byte flags; - int game_id = GAME_GetGame(); if (!_soundInitialized) { return R_FAILURE; } + flags = SoundMixer::FLAG_AUTOFREE; + + if (buf->s_samplebits == 16) + flags |= (SoundMixer::FLAG_16BITS | SoundMixer::FLAG_LITTLE_ENDIAN); + if (buf->s_stereo) + flags |= SoundMixer::FLAG_STEREO; + if (!buf->s_signed) + flags |= SoundMixer::FLAG_UNSIGNED; + + // FIXME: Remove the code below if the code above works. + +#if 0 + int game_id = GAME_GetGame(); + if((game_id == R_GAME_ITE_DISK) || (game_id == R_GAME_ITE_DEMO)) { flags = SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE; } else { flags = SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS | SoundMixer::FLAG_LITTLE_ENDIAN; } +#endif + _mixer->playRaw(&_voiceHandle, buf->res_data, buf->res_len, buf->s_freq, flags); return R_SUCCESS; |