Opened 21 years ago

Closed 21 years ago

Last modified 5 years ago

#1128 closed defect (fixed)

ALL: broken samples with monster.sog

Reported by: SF/logicdeluxe Owned by: fingolfin
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game:


When using monster.sog some of the samples are missing a bit from the end, so they sound chopped off. To reproduce this (within just a minute or so), use the DOTT demo and just run: extract --vorbis monster.sou The bug is very audible with the tentacle walking sound for example, where the end is missing (which is the much louder part of the sound). While running extract, the temporary tempfile.ogg of this particular sound is complete and plays all fine in Winamp for example. So it's definately not Oggenc's fault. (This can be reproduced with other games, as well. It just takes more time to encode the monster.sou then. For example, listen to the Sam&Max English talkie intro, where you can hear very well that the ends are missing with several lines and SFXs.) This bug is present in ScummVM 0.5.3cvs (Aug 7 2003 15:28:55) AND also in the 0.5.0 release version. I'm using the Windows version. The Oggenc used is the official v1.0 release. I tested it with several quality levels from -q -1 up to -q 10. The missing parts are always the same.

Ticket imported from: #784837. Ticket imported from: bugs/1128.

Attachments (3)

extract.diff (824 bytes ) - added by SF/olki 21 years ago.
extract2.diff (1.0 KB ) - added by SF/logicdeluxe 21 years ago.
Use after the previous submitted extract.diff is applied! (233.9 KB ) - added by SF/logicdeluxe 21 years ago.
I hope this is helpful for you.

Download all attachments as: .zip

Change History (23)

by SF/olki, 21 years ago

Attachment: extract.diff added

comment:1 by SF/olki, 21 years ago

The attached patch should fix the bug. Not commiting myself since back in November when I first noticed the bug, I was assured that it wasn't a problem...

comment:2 by SF/logicdeluxe, 21 years ago

It sounds fine with the 0.5.1 release but still wrong with ScummVM 0.5.3cvs (Aug 8 2003 22:10:24)

comment:3 by fingolfin, 21 years ago

logicdeluxe, do you mean: "with my old .so3 file..." or do you mean "after applying olki's patch and re-running extract..."

I see why olki's patch would help, but it also means that everybody will have to rerun "extract" on their .sou files, wouldn't it ? Any opinion, Ender?

comment:4 by fingolfin, 21 years ago

Owner: set to SF/ender

comment:5 by SF/ender, 21 years ago

Owner: SF/ender removed

comment:6 by SF/ender, 21 years ago

I don't really have an opinion, given the comment about working with the 0.5.1 release. We need to know if there is a regression in the trunk code and whether the patch makes a difference first.

comment:7 by SF/logicdeluxe, 21 years ago

I looked at that extract.diff This just solves the rounding error problem, but actually it has nothing to do with this particular bug. And, yes, I did not rerun Extract, as I didn't tried the patch anyway. So I used the same monster.sog with both ScummVM-Versions, which was made with the unmodified extract.exe and the oggenc v1.0 release. This bug can be downtracked to ScummVM itself since release 0.5.3 does it right for some reason. I checked it again, and sorry, I stated it wrong: This bug is NOT present in 0.5.0 release, it's a recent CVS regression it seems. I also just checked it with ScummVM 0.5.0pre-cvs (Aug 2 2003 02:02:46) and it runs fine there as well.

comment:8 by fingolfin, 21 years ago

I should have explained this, sorry: There is a "regression" in current CVS, yes: we fixed a long standing problem. ScummVM's audio mixer now deals wiht arbitrary sampling rates.

The data in the monster.sog are really 22050Hz and 11025Hz. But the code in extract.c incorrectly encoded the MP3 files it procudes ass 22222Hz and 11111Hz. In the past that was no problem, because we simply didn't do any rate conversions on MP3 files. But now we do.

The bug is that extrac.c creates incorrect output files (an issue olki apparently reported a long time ago, and which the here attached bug fixes). The problem only was not apparent for a long time, because it was cancelled out by another bug in ScummVM: we played the MP3 data incorrectly, thus by chance playing it at the correct rate.

comment:9 by SF/logicdeluxe, 21 years ago

Well, I tried the patch, and there is no noticable difference. The rounding errors really are way too small to do such BIG troubles. And I still don't see how it could solve the problem. The size is given in samples and not in a timebase anyway. The resulting playing time from Oggenc's output should not matter either, since the samples also have different durations in different languages. The resulting ogg encoded sample also has a rate different from the original (ie always 22050 Hz) anyway. I really think it is ScummVM itself, which does the error. And anyway, if the rounding error were the problem, then wouldn't the bug appear with mp3 as well?

comment:10 by SF/olki, 21 years ago

Owner: set to SF/olki
Status: newclosed

by SF/logicdeluxe, 21 years ago

Attachment: extract2.diff added

Use after the previous submitted extract.diff is applied!

comment:11 by SF/logicdeluxe, 21 years ago

What's the matter with this? The bug is still there in ScummVM 0.5.3cvs (Aug 12 2003 11:47:15). Btw. with that patch you never get 11025 Hz, I fixed that one with extract2.diff. I hope, I got it right, it's my first try. Oggenc runs a lot faster with it. Seems it is happier with 11025 Hz than with 11111 Hz, but that does not fix the actual bug, I'm talking about. Just try DOTTDEMO with monster.sog and compare it with the 0.5.1 release which does it right. Even the monster.sog was created with the patched extract, it does not change anything about this bug. The patch just avoids useless resampling. Another problem I noticed is, that Oggenc doesn't seem to like the resampling option with identical source and target rates, as it crashes with some samples, which did not happen before extract.diff was applied. I fixed that one, too.

comment:12 by SF/olki, 21 years ago

yep. silly me forgot and "else".... anyway, it's commited along with the resampling fix. thanks.

comment:13 by SF/logicdeluxe, 21 years ago

Status: closednew

comment:14 by SF/logicdeluxe, 21 years ago

Obviously this is not meant to be closed as the issue is not solved yet. If I got something wrong, I would appreciate a reason mentioned somewhere appropriate. I sampled it from DOTTDEMO to show you the difference. Original.ogg is sampled with the original interpreter, 053monstersou.ogg is sampled using ScummVM 0.5.3cvs with original monster.sou, 053monstersog.ogg is sampled using ScummVM 0.5.3cvs and 051monstersog.ogg is sampled using ScummVM 0.5.1 release version. Monster.sog was made with the latest extract.exe from CVS with the corrected round off errors. Oggenc was version 1.0. Especially listen carefully to the "that" in the first line and to the tentacle walk noise!

by SF/logicdeluxe, 21 years ago

Attachment: added

I hope this is helpful for you.

comment:15 by SF/olki, 21 years ago

Owner: SF/olki removed

comment:16 by fingolfin, 21 years ago

Owner: set to fingolfin

comment:17 by fingolfin, 21 years ago

This seems to be fixed in latest CVS (I recently applied some Ogg playback changes, those might have done it). At least I can hear no difference between my MP3 and my Ogg encoded DOTT monster.sou. Can you confirm this?

comment:18 by SF/logicdeluxe, 21 years ago

Just checked with DOTT, SAM and FOA and it sounds right, now. I can not check it with DOTTDEMO, though, because of another bug currently there. However it seems fixed so far.

comment:19 by fingolfin, 21 years ago

Resolution: fixed
Status: newclosed

comment:20 by digitall, 5 years ago

Component: --Unset--Engine: SCUMM
Note: See TracTickets for help on using tickets.