Apply urkles MI1 MP3 CD Audio patch and Loom MP3 syncronisation fix patch
svn-id: r4049
This commit is contained in:
parent
d447f05709
commit
c74f966991
2 changed files with 19 additions and 7 deletions
|
@ -349,6 +349,7 @@ Credits:
|
|||
Claudio Matsuoka - Daily builds (http://scummvm.sf.net/daily/)
|
||||
Janne Huttunen - Zak256/Indy256/LoomCD actor mask support
|
||||
Jeroen Janssen - Numerous readability and bugfix patches
|
||||
Edward Rudd - Fixes for playing MP3 versions of MI1/Loom Audio
|
||||
Daniel Schepler - Final MI1 CD music support
|
||||
Tim 'realmz' - Initial MI1 CD music support
|
||||
Jonathan 'khalek' - Expert weaver in the Loom
|
||||
|
|
19
sound.cpp
19
sound.cpp
|
@ -106,8 +106,13 @@ void Scumm::playSound(int sound)
|
|||
ptr = getResourceAddress(rtSound, sound);
|
||||
if (ptr != NULL && READ_UINT32_UNALIGNED(ptr) == MKID('SOUN')) {
|
||||
ptr += 8;
|
||||
#ifdef COMPRESSED_SOUND_FILE
|
||||
playMP3CDTrack(ptr[16], ptr[17] == 0xff ? -1 : ptr[17],
|
||||
(ptr[18] * 60 + ptr[19]) * 75 + ptr[20], 0);
|
||||
#else
|
||||
_system->play_cdrom(ptr[16], ptr[17] == 0xff ? -1 : ptr[17],
|
||||
(ptr[18] * 60 + ptr[19]) * 75 + ptr[20], 0);
|
||||
#endif
|
||||
current_cd_sound = sound;
|
||||
return;
|
||||
}
|
||||
|
@ -717,7 +722,7 @@ void Scumm::playMP3CDTrack(int track, int num_loops, int start, int delay) {
|
|||
if (_soundsPaused)
|
||||
return;
|
||||
|
||||
if (!start && !delay) {
|
||||
if (!num_loops && !start) {
|
||||
_mixer->stop(_mp3_handle);
|
||||
return;
|
||||
}
|
||||
|
@ -728,11 +733,17 @@ void Scumm::playMP3CDTrack(int track, int num_loops, int start, int delay) {
|
|||
|
||||
// Calc offset
|
||||
frame_size = 144 * _mad_header[index].bitrate / _mad_header[index].samplerate;
|
||||
offset = (long)((float)start / (float)75 * 1000 /
|
||||
(float)((float)1152 / (float)_mad_header[index].samplerate *
|
||||
1000) * (float)(frame_size + 0.5));
|
||||
offset = (long)( (float)start / (float)75 * ((float)_mad_header[index].bitrate/(float)8));
|
||||
|
||||
// Calc delay
|
||||
if (!delay) {
|
||||
struct stat file_stat;
|
||||
fstat(fileno(_mp3_tracks[index]),&file_stat);
|
||||
mad_timer_set(&duration, 0,file_stat.st_size, (_mad_header[index].bitrate/8));
|
||||
} else {
|
||||
mad_timer_set(&duration, 0, delay, 75);
|
||||
}
|
||||
|
||||
// Go
|
||||
fseek(_mp3_tracks[index], offset, SEEK_SET);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue