Anyone know if it's possible to extract Loom's CDDA.SOU?

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

Moderator: ScummVM Team

apprentice_fu
Posts: 12
Joined: Thu Dec 23, 2010 8:16 am
Location: Germany

Post by apprentice_fu »

As my previous post was a bit vague:

The offset at the start of the file seems to be 800 bytes (or 800 + x*1177)

With stereo, 8-bit, 44100 Hz and 13.33 ms you get 1176 bytes audio data + 1 byte shifting info. The shifting info is at the start of such a

The lower four bits of the shifting info (info & 0xf) are for the right channel the higher four (info >> 4) are for the left channel.

At the beginning of the file there are some bytes (0x10 up to 0x1f) which I can't make sense of.

(edit corrected bits to bytes)
Last edited by apprentice_fu on Sun Feb 02, 2014 6:37 pm, edited 1 time in total.
User avatar
icanntspell
Posts: 95
Joined: Mon May 18, 2009 12:14 pm
Location: The Netherlands
Contact:

Post by icanntspell »

Thanks a lot, great work! I managed to build a working decoder with this info. It took me some time to realize it was encoded in signed pcm. I am not really an audio guy as well.
jepael
Posts: 32
Joined: Sat Oct 25, 2008 8:16 pm

Post by jepael »

apprentice_fu wrote:
With stereo, 8-bit, 44100 Hz and 13.33 ms you get 1176 bytes audio data + 1 byte shifting info.
The 1176 is an interesting value, as one audio CD sector contains 1176*2=2352 bytes of 16-bit stereo data. It may be that the game internally uses cd-rom sector numbers or the minute:second:frame format when it starts playing the audio. There are 75 frames (audio sectors) per second.
User avatar
clone2727
Retired
Posts: 1611
Joined: Fri Jun 09, 2006 8:23 pm
Location: NJ, USA

Post by clone2727 »

jepael wrote:The 1176 is an interesting value, as one audio CD sector contains 1176*2=2352 bytes of 16-bit stereo data. It may be that the game internally uses cd-rom sector numbers or the minute:second:frame format when it starts playing the audio. There are 75 frames (audio sectors) per second.
Of course it references the audio data that way; they didn't actually change the SCUMM data from the CD version. In Loom's case, it specifies offset from the beginning of the disc (see scumm/script_v5.cpp:2612).
dtungsten
Posts: 1
Joined: Mon Feb 03, 2014 10:37 pm

Post by dtungsten »

icanntspell wrote:Thanks a lot, great work! I managed to build a working decoder with this info. It took me some time to realize it was encoded in signed pcm. I am not really an audio guy as well.
I managed to build a working decoder too, thanks!
User avatar
Ohrwerk
Posts: 7
Joined: Wed Sep 06, 2023 6:05 pm

Re: Anyone know if it's possible to extract Loom's CDDA.SOU?

Post by Ohrwerk »

Does anyone know if there is a tool to extract the audio files? I only found XXX, but I can't get it to work.
https://github.com/symm/LAAExtract
User avatar
eriktorbjorn
ScummVM Developer
Posts: 3561
Joined: Mon Oct 31, 2005 7:39 am

Re: Anyone know if it's possible to extract Loom's CDDA.SOU?

Post by eriktorbjorn »

Ohrwerk wrote: Wed Sep 13, 2023 10:50 am Does anyone know if there is a tool to extract the audio files? I only found XXX, but I can't get it to work.
https://github.com/symm/LAAExtract
I could be wrong, but I think CDDA.SOU in Loom, like the audio track from the CD version, is one single audio file where the game tells which parts of it to play. In that case, there are no markers in the file to tell where one audio clip stops and the next one begins. The audio decoder for it in ScummVM is in engines/scumm/cdda.cpp but of course turning that into a working extraction tool is left as an exercise for the reader.
User avatar
Ohrwerk
Posts: 7
Joined: Wed Sep 06, 2023 6:05 pm

Re: Anyone know if it's possible to extract Loom's CDDA.SOU?

Post by Ohrwerk »

Yes that's right, but curiosity is the cat's death.
A single WAV file is created which contains the voice output and at the end two pieces of music and harp sounds.
Thanks to the analog recordings of that time and the long pauses, you can quite well recognize the individual passages with Audacity.
Theoretically, one could translate the spoken texts, but whether that is worth the effort...

I have now also got LAAExtract running.
With the 32 bit versions it worked for me.
(python-2.7.13 and pywin32-217.win32-py2.7)
But you have to put the game folder, even if it is from GOG, into the Steam folder.
C:\Program Files (x86)\STEAM\steamapps\common

See also (for links and description): viewtopic.php?p=84307#p84307
User avatar
eriktorbjorn
ScummVM Developer
Posts: 3561
Joined: Mon Oct 31, 2005 7:39 am

Re: Anyone know if it's possible to extract Loom's CDDA.SOU?

Post by eriktorbjorn »

Ohrwerk wrote: Mon Sep 18, 2023 6:04 am Theoretically, one could translate the spoken texts, but whether that is worth the effort...
Possible yes, but as you say it sounds like a lot of effort. The easiest would probably be to make sure that timing of the translated lines match the original, like when a movie is dubbed into another language. Otherwise, you'd have to update the scripts as well. (Which I guess is what the "ultimate talkie" versions of Monkey Island 1 and 2 does, and that just boggles my mind.) But even so, you'd also have to re-record music and sound effects for the parts where they are mixed together.
User avatar
Ohrwerk
Posts: 7
Joined: Wed Sep 06, 2023 6:05 pm

Re: Anyone know if it's possible to extract Loom's CDDA.SOU?

Post by Ohrwerk »

You would first need a Text script from the respective language version, reasonable speakers, good audio recording and mixing and a lot of work to change the scripts. In addition, one would have to make a new version of the radio play, so that the voices fit together. The effort is getting bigger and bigger ;-)
There is no german Ultimate Talki from DOT, so what the heck. But we can dream...
And anyway, I only play the EGA version of Loom, because it is a real masterpiece in EGA graphics.
But the sound... I already listened to the Swan Lake LP from my parents while playing Loom.
I'm trying to create the audio files for the EGA version, it would be nice to have the MIDI files from the MT32 version, but I haven't found a tool to extract them yet. So for now I'm waiting for my Naxos CD of Swan Lake which was used in the FAQ.
jjtt
Posts: 1
Joined: Sat Jun 15, 2024 12:29 am

Re: Anyone know if it's possible to extract Loom's CDDA.SOU?

Post by jjtt »

Hi there!, my name is José. I'm working on a musical/artistic conceptual project and maybe some of you can help me. My idea is to recompose, arrenge and produce Loom's soundtrack from scratch. I figured if i can extract the CDDA.SOU file to wav and then change it and convert it to its original format, I can get the game to play with my Soundtrack. Any of you can suggest me an easy way to do this?, I saw the "Loom CDDA Converter" at github but I dont really know how to use it and if it works the other way around (WAV to SOU).

Any help is much appreciated!
User avatar
Praetorian
ScummVM Developer
Posts: 883
Joined: Tue May 08, 2007 8:54 am
Location: Greece
Contact:

Re: Anyone know if it's possible to extract Loom's CDDA.SOU?

Post by Praetorian »

jjtt wrote: Sat Jun 22, 2024 4:09 pm Hi there!, my name is José. I'm working on a musical/artistic conceptual project and maybe some of you can help me. My idea is to recompose, arrenge and produce Loom's soundtrack from scratch. I figured if i can extract the CDDA.SOU file to wav and then change it and convert it to its original format, I can get the game to play with my Soundtrack. Any of you can suggest me an easy way to do this?, I saw the "Loom CDDA Converter" at github but I dont really know how to use it and if it works the other way around (WAV to SOU).

Any help is much appreciated!
The "Loom CDDA Converter" is (as of yet) converting only one way, that is SOU to WAV.

I am not sure there's a tool that will convert WAV back to SOU for LOOM; from a quick search I haven't found any.

Keep in mind that the CDDA file mainly contains the voiced cues, voiced cutscenes and SFX. The music tracks are not discretely "isolated" but (mostly) play as a music "carpet" to the voiced cutscenes. On occasion the game will play a segment of music (but cut it before the "voiced segment" on top of it begins -- or I guess in some cases it could be that it plays it after -- afaik this is mainly for re-using the intro theme of LOOM). Also, there would be potential side-effects to watch out for when editing this file (eg. the timings should be left intact).

Unless you have specific reason to work with the talkie version, I'd suggest looking into ScummVM's recent support of external audio tracks for the floppy version (and other non-talkie versions) of LOOM.
https://wiki.scummvm.org/index.php/Loom#Audio_tracks
Post Reply