diff options
author | Torbjörn Andersson | 2004-11-24 15:02:00 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2004-11-24 15:02:00 +0000 |
commit | 87ffc13324175dcc91cb33664ed4993a672830a5 (patch) | |
tree | 4e5b1ff5f28af554972c93827a66d3fd683b4873 /saga/sndres.cpp | |
parent | 373a19eef168c14afdbc4215957278dff530a521 (diff) | |
download | scummvm-rg350-87ffc13324175dcc91cb33664ed4993a672830a5.tar.gz scummvm-rg350-87ffc13324175dcc91cb33664ed4993a672830a5.tar.bz2 scummvm-rg350-87ffc13324175dcc91cb33664ed4993a672830a5.zip |
Added the voice-overs and partial subtitles for the IHNM intro monologue.
svn-id: r15877
Diffstat (limited to 'saga/sndres.cpp')
-rw-r--r-- | saga/sndres.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/saga/sndres.cpp b/saga/sndres.cpp index 096e83752b..a9feb2508a 100644 --- a/saga/sndres.cpp +++ b/saga/sndres.cpp @@ -369,8 +369,27 @@ int SndRes::getVoiceLength(uint32 voice_rn) { ms_f = (double)length / 14705 * 1000.0; ms_i = (int)ms_f; } else if (res_type == GAME_SOUND_WAV) { - // TODO! - return -1; + // IHNM does not use the same format for all its WAV sounds, so + // we just have to load the stupid thing and see what that will + // tell us about it. + + SOUNDBUFFER snd_buffer; + + result = load(_voice_ctxt, voice_rn, &snd_buffer); + if (result != SUCCESS) { + return -1; + } + + ms_f = (double)snd_buffer.s_buf_len; + if (snd_buffer.s_samplebits == 16) { + ms_f /= 2.0; + } + if (snd_buffer.s_stereo) { + ms_f /= 2.0; + } + + ms_f = ms_f / snd_buffer.s_freq * 1000.0; + ms_i = (int)ms_f; } else { return -1; } |