Discworld audio compression planned?

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
User avatar
Who'sThere
Posts: 46
Joined: Wed Dec 31, 2008 12:18 am

Discworld audio compression planned?

Post by Who'sThere »

Just wondering if the upcoming release will support some type of audio compression of the Discworld I & II games?

I'm leaning more towards number 1 as I have that, but I'm assuming that they both used the same file formats..?
User avatar
DrMcCoy
ScummVM Developer
Posts: 595
Joined: Sat Dec 17, 2005 1:33 pm
Location: Braunschweig, Germany
Contact:

Re: Discworld audio compression planned?

Post by DrMcCoy »

Who'sThere wrote:I'm assuming that they both used the same file formats..?
No. Discworld 1 uses raw PCM data, while Discworld 2 compresses its sounds using an ADPCM codec.

Anyway, there currently is a working (but not much tested) compression tool for both versions in the SVN repository.
The upcoming release will play these, yes.
zoppologo
Posts: 12
Joined: Sun Sep 24, 2006 5:32 pm

Post by zoppologo »

I noticed that ogg compression for Discworld 1 works fine, but flac compressiom doesn't. Is it implemented?
MarkCoolio
Posts: 13
Joined: Mon May 12, 2008 9:54 am

Re: Discworld audio compression planned?

Post by MarkCoolio »

DrMcCoy wrote:
Who'sThere wrote:...
Anyway, there currently is a working (but not much tested) compression tool for both versions in the SVN repository.
The upcoming release will play these, yes.
I already wrote in other tinsel compression thread. Question now: has the tool run through tests since your last post? I mean do you see it as stable or should one wait until next release? I already compressed DW1 and DW2 successfully but at least with the compressed files from DW I got some messages like "WARNING: Unknown MIDI offset 620146!". So I am not sure if really everything got compressed successfully. Hope u can help.
zoppologo
Posts: 12
Joined: Sun Sep 24, 2006 5:32 pm

Post by zoppologo »

[quote="zoppologo"]I noticed that ogg compression for Discworld 1 works fine, but flac compression doesn't. Is it implemented?[/quote]
User avatar
jimi
Posts: 7
Joined: Wed Jul 01, 2009 12:04 pm

Re: Discworld audio compression planned?

Post by jimi »

MarkCoolio wrote:I already wrote in other tinsel compression thread. Question now: has the tool run through tests since your last post? I mean do you see it as stable or should one wait until next release? I already compressed DW1 and DW2 successfully but at least with the compressed files from DW I got some messages like "WARNING: Unknown MIDI offset 620146!". So I am not sure if really everything got compressed successfully. Hope u can help.
The sound files only contain sample data, no midi data. Are you sure that this warning happens only when using the compressed sample data files?

btw. a typo in the engine actually caused it to identify flac compressed data as being uncompressed. It's now fixed, so flac also works.
User avatar
eriktorbjorn
ScummVM Developer
Posts: 3550
Joined: Mon Oct 31, 2005 7:39 am

Re: Discworld audio compression planned?

Post by eriktorbjorn »

MarkCoolio wrote:I already compressed DW1 and DW2 successfully but at least with the compressed files from DW I got some messages like "WARNING: Unknown MIDI offset 620146!". So I am not sure if really everything got compressed successfully. Hope u can help.
From what I can see, the engine tries to convert an offset into a data file (to where the music it wants to play begins) to a track number so that it can, optionally, play music from the ScummVM Music Enhancement Project. But in this case, it didn't recognize the offset. (The offsets are hard-coded in the Tinsel engine.)

I think the warning itself is pretty harmless. It should simply go on to play the MIDI version of the music instead. Assuming the music plays for you (i.e. the offset isn't caused by a corrupted file), I don't know what's wrong in this case. I guess there either isn't any enhanced version of that particular song, or the conversion from offset to track number is wrong for some versions of the game.
User avatar
jimi
Posts: 7
Joined: Wed Jul 01, 2009 12:04 pm

Post by jimi »

If it plays music depending on what sample is played (sample offset), then that would need to get fixed. Anyway such behaviour would only work on the English (uncompressed) version of the game, so it would not be good anyway. Perhaps one should have done it by using the sample index, because that doesn't change.
User avatar
LordHoto
ScummVM Developer
Posts: 1029
Joined: Sun Oct 30, 2005 3:58 pm
Location: Germany

Post by LordHoto »

jimi wrote:If it plays music depending on what sample is played (sample offset), then that would need to get fixed. Anyway such behaviour would only work on the English (uncompressed) version of the game, so it would not be good anyway. Perhaps one should have done it by using the sample index, because that doesn't change.
I don't know what you are calling "sample" here. Maybe you would want to explain that.

As I understand it the Tinsel (at least DW1) music playback works like this:

The game scripts (whatever) do pass a file offset to the function, which is used to play a MIDI track (MIDI is not sample based btw.). It takes that offset and looks at it in the datafiles containing the music data and plays back the MIDI data found there.

Now to get the DW enhanced music working there is code to compare the passed offset against a table, which contains plain offset values. If a matching offset is found the table index is used to decide which track of the enhanced music soundtrack should be played.

AFAIK there is no other way to achieve that. To support game versions with different offsets, one would need to add another table with all offsets used in that version. I guess the developer, who added that offset table did have a different game version than the one, which triggers this warning.

Of course the warning should be harmless, when you do not use the enhanced music soundtrack at all.
Post Reply