Opened 21 years ago

Closed 21 years ago

Last modified 5 years ago

#1087 closed defect (fixed)

SIMON1/2: Sound problems

Reported by: Kirben Owned by: fingolfin
Priority: normal Component: Engine: AGOS
Version: Keywords:
Cc: Game: Simon the Sorcerer 1

Description

Using ScummVM 0.5.3cvs. English versions of Simon the Sorcerer 1 and 2. Compiled under mingw with GCC 3.2.3 and running under Windows XP.

simon1talkie sound effects/speech and simon1win sound effects/speech cause the following error: Assertion failed: input.isStereo() == stereo, file sound/rate.h, line 81

simon2talkie sound effects/speech and simon2win sound effects/speech are been played back too fast.

The problems don't occur when using mp3s for sound effects/speech. The problems don't occur in 0.5.0cvs branch.

Ticket imported from: #780167. Ticket imported from: bugs/1087.

Change History (26)

comment:1 by eriktorbjorn, 21 years ago

I've committed a partial fix that seems to stop it from crashing, but I think the sounds play at the wrong rate.

comment:2 by fingolfin, 21 years ago

Status: newclosed

comment:3 by fingolfin, 21 years ago

Resolution: fixed

comment:4 by fingolfin, 21 years ago

Fixed. And let me point out, it wasn't my fault this time <g>

comment:5 by Kirben, 21 years ago

Status: closednew

comment:6 by Kirben, 21 years ago

I no longer get crashes in simon1 and sound is playing at correct speed but there is a lot of cracking in the sound now.

comment:7 by fingolfin, 21 years ago

Priority: highnormal

comment:8 by fingolfin, 21 years ago

Can't reproduce this right now since my voice data is MP3 compressed, and that isn't rate changed at all. What sampling rate does the original sound data use?

Still this is hardly priority 7.

comment:9 by Kirben, 21 years ago

All Simon the Sorcerer 1 verisons use PCM 22kHz, 8 bit, mono All Simon the Sorcerer 2 versions use PCM 11kHz, 8 bit, mono

The priority 7 was for when simon1 was crashing, forgot to lower it with last post.

comment:10 by Kirben, 21 years ago

I should have been more exact in that last post: All Simon the Sorcerer 1 verisons use PCM 22050kHz, 8 bit, mono All Simon the Sorcerer 2 versions use PCM 11025kHz, 8 bit, mono

Check http://members.optusnet.com.au/wormmon/simon_formats.htm l if you need more details

comment:11 by fingolfin, 21 years ago

That's very odd. Because ScummVM does its sound playback by default with 22050Hz, and if Simon 1 uses exactly this sampling rate, then there is no rate conversion involved at all! So I don't see how the new code could introduce any problems... hum

BTW, I find it odd that they decreased the quality in the newer version... any idea why that is so?

comment:12 by Kirben, 21 years ago

I don't understand why Adventure Soft lowered the sample rate in their second game but I'm sure the rates I posted are correct. I ripped out all the sound effects and voices files out of each PC version to compare.

I just noticed that ambient sounds no longer loop in Simon the Sorcerer 2 now either.

comment:13 by Kirben, 21 years ago

A good example of the crackling is after the typewriter sound in the Loan Office in simon2win. Sound effects are stored in game file so should be able to easily reproduce this one. Just go north from start of game, choose Loan Office and enter building. It helps if you turn off music too.

comment:14 by fingolfin, 21 years ago

Yes, looping wasn't implemented. I just checked in some code that should work, but it's not tested.

Still it's beyondy me why the Simon1 sound shows problems. The Dig uses 22050hz data, too, and I noticed no cracking. There is no rate conversion involved at all. Hrm :-/

comment:15 by fingolfin, 21 years ago

Just for comparision, all voices in The Dig are 8 bit unsigned 22050 Hz, too. In particular it prints for me:

makeRateConverter: inrate 22050, outrate 22050, mono data has 8 bits and is unsigned

If you have The Dig, could you try this out (you just have to start the game, skip the intro, and let the actors talk)... Do they sound normal (the sound quality of course isn't perfect to start with). You could maybe compare once with the old and once with the new mixing code, for comparision.

When you play simon1, where you get the cracking noises, what does the "makeRateConverter" debug output say?

comment:16 by Kirben, 21 years ago

The crackling in speech doesn't occuring when using mp3 files either, which makes it more difficult to give examples for you.

I don't know of a good place to find the crackle in the Simon the Sorcerer 1, since there isn't much use of frequent sounds in that game. Have you tried the place I mentioned earlier in simon2win ?

The ambient sound effects lopping now causes a brief bit a silence between each loop. Start simon2 (any version), go north, choose fountain and go to the right. The fountain is an ambient looping sound.

comment:17 by Kirben, 21 years ago

The debug from the simon2win example I gave earlier is always this line: makeRateConverter: inrate 11025, outrate 22050, mono
data has 8 bits and is unsigned

comment:18 by Kirben, 21 years ago

I just compared The Dig, the speech sounds the same under both 0.5.0cvs and 0.5.3cvs. I noticed no extra sound problems.

comment:19 by fingolfin, 21 years ago

MP3 files go thru different code than "normal" sound data, so if they work, that doesn't mean much.

comment:20 by fingolfin, 21 years ago

Just to clarify this: when you remove this line from sound/ mixer.cpp: #define SOX_HACK (or comment it out), then the crackling vanishes? I am asking because in the past couple days I also made some changes in the simon code which invokes the mixer, and I want to know if that broke it, or not.

comment:21 by eriktorbjorn, 21 years ago

This should be fixed in the latest CVS.

The problem was that at the end of st_rate_flow() rate->ilast and rate->cur would have the same values, which led to some samples being duplicated at the beginning of the next conversion.

I changed it to fill rate->icur from the input stream. I hope I didn't break anything.

comment:22 by Kirben, 21 years ago

Status: newclosed

comment:23 by fingolfin, 21 years ago

Status: closednew

comment:24 by fingolfin, 21 years ago

The fix is incorrect. You read from the input stream without update ipos, for one thing. It might cure the symptom, but causes new issues.

comment:25 by Kirben, 21 years ago

Status: newclosed

comment:26 by digitall, 5 years ago

Component: Engine: AGOS
Game: Simon the Sorcerer 1
Note: See TracTickets for help on using tickets.