The Free
Software Foundation
web page talks about what "free software" means.
For more information, look on the Open Source Initiative web site which includes a description of what Open Source means and their certification of the GPL version 3.
Here is the copyright notice for those two licenses:After
banging my head on it for a few days off and on, I managed to figure
out the audio directory structure. Starting at 0x0100 there is a series
of 16 byte records running up through 0x10E0. I don't have all the
fields nailed down yet, but audio sample location and length seems to
be spot on. Everything is referenced by frames (16bit) and sample
offset count. I've tried this with a few PS2 and PS3 files and they all
seem to map correctly. The following is an example of the first 3
records for a PS2 sd70ace file I pulled
(R092PF3SD70ACe_ALL100107aF2X.MTH) that should explain it a little
better. There's more data further in the header section I haven't
worked on yet, but I'm now able to pull all discrete audio from the
file. I'm a ways off from modifying or porting soundsets, but it
definitely seems doable.Frames are 16bit (65,536 byte frame size). Found some more tidbits last week when exploring newer PS3 files. Found some audio that wasn't ADPCM! Took some digging and bit fiddling, but ended up 24bit PCM in big endian. So it seems that page and offset references are by nibble count, not necessarily sample rate. Not sure why the 4bit references yet, but it seems to hold true. I threw together a little C# app and am able to extract all the raw audio data into separate files as well as play the 24bit PCM within the app. Once I get the ADPCM decoding and playing within the app I'll post something for people to play with. Been looking for checksum data, but haven't located it yet. Nothing in the upper header anyways. Still more stuff to parse between the directory structure and audio data. |
|
|
Start Rep - the
offset into the sound file of the start of a repeatable segment of a
clip.
End Rep
- the offiset into the sound file of the end of a repeatable segment of
a clip.SM Init- For IMA/DVI ADPCM clips this is "State machine initialization" - for the programers out there : the ADPCM decompressor is written as a state machine. The decompressor state machine requires two pieces of data at startup - the initial state and previous sound value. When you start a clip from the beginning, both of these values are usually zero. A repeating segment, which may start in the middle of a clip, needs to know these two pieces of data to produce the correct sound. You can look at the code if you are really interested. For 24 bit signed PCM clips, I don't know what this field in the index used for because it does sometimes contain a non-zero value. |
Here is a listing of the vox_to_ima.bat
batch file:
@echo off |
Here is a hint from Sam via the OGR
forum : So happy to have found this thread - and really appreciate the work done to decipher the MTH sound files and assemble a program to manipulate the sounds inside. I have a PS2 steamer pulling my Polar Express around our Christmas village. Not only were the sounds not really appropriate for the Polar Express, but the command environment made it so the conductor announcement car was not functional. This is no longer an issue! Following the directions above, I was able to use ADPCM, Audacity, and sox to successfully replace all of the engine sounds this afternoon. The only caveat, I was never able to export from Audacity to vox format for sox conversion. Instead, when exporting from Audacity, I set "Save as type" to "(external program)". The command was specified as "C:\Program Files (x86)\sox-14-4-2\sox.exe" -t wav - -e ima-adpcm -c 1 "%f" allowing Audacity to pipe its wav output directly into sox, skipping the intermediate vox step. Thanks
again! |
Random aside: Apple computers are typically big-endian, Intel based computers (ie Windows) are little-endian. Guess which type of computers that MTH uses for developing sound files! If you don't know about Little Indians and Big Indians, you can google "byte ordering" or click here: Endianness. |
Here is a listing of the le_to_be.bat
batch file:
@echo off |
Index | Description of sound in the H9 | Clip copied from the Mohawk | Description of sound in the Mohawk | Clip Size in Bytes |
41 | empty | 41 | 1x toot | 4418 |
42 | 1x toot | 255 | Xing Signal | 52158 |
43 | 2x toot | 43 (2x toot) | 2x toot | 7429 |
44 | 3x toot | 44 | 3x toot | 7555 |
121 | Coors Door Open | * | - | |
122 | Coors Door Close | * | - | |
152 | Whistle | 152 | Whistle | 4933 |
153 | Whistle Ending 1 | 153 | Whistle Ending 1 | 5218 |
154 | Whistle Ending 2 | 154 | Whistle Ending 2 | 16484 |
155 | Whistle Ending 3 | 155 | Whistle Ending 3 | 6466 |
156 | Whistle Ending 4 | 156 | Whistle Ending 4 | 11669 |
157 | Bell | 157 | Bell | 11616 |
243 | empty | 41 | 1x toot | 4418 |
Here is a listing of that
batch file:@echo off |
email : markd@silogic.com
The DiVecchio
genealogy home page
The Frazzini
genealogy home page
This site will be under construction for a while.