Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#3590 closed defect (fixed)

FOTAQ: Low sample rate

Reported by: SF/j_w_ Owned by: cyxx
Priority: normal Component: Engine: Queen
Version: Keywords:
Cc: Game: Flight of the Amazon Queen

Description

The voices in Flight of the Amazon Queen appear to be playing at a lower sample rate in ScummVM than it does in DOS.

I have noticed this with the original audio and Ogg Vorbis compressed audio using the Windows version as well as the Windows CE version of ScummVM 0.11.0 and older versions.

I am using the original English Talkie version of the game.

Ticket imported from: #1876741. Ticket imported from: bugs/3590.

Attachments (3)

1876741.diff (2.9 KB ) - added by cyxx 16 years ago.
queen-sound1.diff (4.3 KB ) - added by eriktorbjorn 16 years ago.
Patch against current SVN
queen-sound2.diff (2.4 KB ) - added by eriktorbjorn 16 years ago.
Alternative patch against current SVN

Download all attachments as: .zip

Change History (22)

comment:1 by bluegr, 16 years ago

Summary: Sample rate a bit too low?FOTAQ: Low sample rate

comment:2 by fingolfin, 16 years ago

Owner: set to cyxx

comment:3 by fingolfin, 16 years ago

How do you know that the sample rate is lower?

comment:4 by fingolfin, 16 years ago

Owner: changed from cyxx to joostp

comment:5 by fingolfin, 16 years ago

Or maybe Joost has something to add...

comment:6 by cyxx, 16 years ago

Looking at the disasm of the DOS executable, it seems .SB files have a "playback frequency index" field we don't handle/read (it's not at a fixed offset, as the header has variable length).

The frequency table is

3951, 4186, 4435, 4699, 4978, 5274, 5588, 5920, 6272, 6645, 7040, 7459, 7902, 8372, 8870, 9397, 9956, 10548, 11175, 11840, 12544, 13290, 14080, 14917, 15804, 16744, 17740, 18795, 19912, 21096, 22351, 23680, 25088

I just looked at a single file, the index is equal to 19 (11840 Hz) in it...

TODO: properly reverse the .SB file format and add the parsing code to ScummVM :)

comment:7 by cyxx, 16 years ago

here's a possible attempt at fixing this (this patch hasn't been tested more than the first rooms) File Added: 1876741.diff

comment:8 by cyxx, 16 years ago

File Added: 1876741.diff

by cyxx, 16 years ago

Attachment: 1876741.diff added

comment:9 by cyxx, 16 years ago

Updated patch (I ran the parsing code on all the .sb files of the french version of the game, and all of them use the frequency index 19, so maybe it would be simplier to just to replace 11025 by 11840 ?). If this gets applied, compress_queen should probably also get updated/'fixed'.

File Added: 1876741.diff

comment:10 by cyxx, 16 years ago

Owner: changed from joostp to cyxx
Resolution: fixed
Status: newclosed

comment:11 by cyxx, 16 years ago

should be fixed with latest SVN (revision 33079).

comment:12 by eriktorbjorn, 16 years ago

Doesn't it also mean that we should update the freeware versions of FotAQ, since the compressed sounds claim to be 11025 Hz, instead of 11840 Hz?

Another alternative, I guess, would be to cheat and add some way of overriding the frequency for compressed sounds.

by eriktorbjorn, 16 years ago

Attachment: queen-sound1.diff added

Patch against current SVN

comment:13 by eriktorbjorn, 16 years ago

I'm attaching two examples of how such a cheat could be implemented. One adds an extra parameter to playInputStream(). The other uses a wrapper class for FotAQ's audio streams. File Added: queen-sound1.diff

by eriktorbjorn, 16 years ago

Attachment: queen-sound2.diff added

Alternative patch against current SVN

comment:14 by eriktorbjorn, 16 years ago

File Added: queen-sound2.diff

comment:15 by cyxx, 16 years ago

Indeed, rebuilt versions need to be fixed (actually they should have already been, see tracker item #1599393 ; but I didn't take the time to do it...).

So, either we release new versions (and update compress_queen, if resampling from 11840 Hz is ok for lameenc/oggenc), either we apply one or your patches...

comment:16 by SF/j_w_, 16 years ago

Hi, I am very pleased that my bug report gets this much attention!

I'd like to add that I am sure OggVorbis is not going to cause any trouble using exotic sample rates. I think MP3 will though, but I'm not sure about LameMP3. I actually try to avoid MP3 as much as possible ;-)

comment:17 by SF/j_w_, 16 years ago

Resolution: fixed
Status: closednew

comment:18 by SF/j_w_, 16 years ago

Resolution: fixed
Status: newclosed

comment:19 by eriktorbjorn, 16 years ago

I just noticed that the second patch leaks memory. I've submitted a fixed version to the patch tracker, where it's less likely to be forgotten.

Note: See TracTickets for help on using tickets.