A poster on another forum posted some of the details that he discovered on the format of the sounds in the .mth file. I took what he did, extended it and put together a small program that can play clips from the .mth file. Its still very much a work in progress.
If you want to try it, you can get it here, along with simple instructions:
http://www.silogic.com/trains/ADPCM.html
includes a *.exe file, full source code for Borland C++ Builder v4. Like my RTC, Remote Train Control program, it's distributed free under the terms of the GNU Public license. I've run it on WinXP and Win7. Should run on Win10.
The audio formats in this file are industry standard formats. Most "low resolution" audio clips are ADPCM (Adaptive differential pulse-code modulation) at a sample rate of 5,512 Hz. "Medium resolution" clips are "24 bit signed PCM" at 11,025 Hz and "High Resolution clips are at 22,050 Hz. The sound files are simple binary files with no encoded or CRC.
Replies sorted oldest to newest
Very cool Mark!
Thanks for posting this and the effort of putting it all together and explaining it. I will be taking a look.
I also want to take a look at your train control program someday, but my layout needs more work before getting into that. Also a Thank You for creating that one too, and for all your efforts there as well.
This can be a handy dandy little tool
fyi, the instructions are confusing, I opened the link and couldn't find the "ADPCM.exe".
Does MTH's website let us hear sound files directly from their site? I am guessing not since you created the application..
Hmm... How hard did you look?
Down in the middle of the page he linked you'll find this...
Look in that ZIP file, and the fifth file in the listing is the EXE file.
Attachments
Here's what I see when I open that link (no exe file). Maybe its due to my work computer, which has restrictions, don't know.
Attachments
Paul,
The first file in the list is the application. You're just not seeing the .exe part due to a Windows setting.
Barry beat me to it, the EXE is there.
I'm having a wonderful time playing with this program. Thank you so much for creating it! I've spent the past few hours trying to figure out how the PS2 files are organized, and have discovered in every file I have examined:
Index location 00000380 is a single, short whistle.
Index location 000003A0 is a double whistle.
Index location 000003B0 is a triple whistle.
Very cool. Thanks again. (BTW, I am running Windows 10 and have had no problems.)
-- 700E
Thanks.
I've noticed that both the 0x390 entry and the very last entry (0x10E0) is the Grade Crossing signal. Seems to be in many PS2 sound files and in all PS3.
Version 1.1.0 of ADPCM is available on my web page
http://www.silogic.com/trains/ADPCM.html
Generally works better and can generate mp3 files from each sound clip.
I spent some time thinking about ways to change the sound file. The simplest way is to replace a clip in one sound file with a clip from another sound file. This does not require any sound format changes.
I added a routine in ADPCM that lets you do that. I have a beta version which I'd like to have some help testing.
You can read about it here:
http://www.silogic.com/trains/ADPCM.html#editing
Mark
That's very cool Mark, nice work!
Version 1.2.0 of my sound file editing program, ADPCM, is available on my web page:
http://www.silogic.com/trains/ADPCM.html
This version lets you
1. play the clips in a sound file
2. copy a clip from one sound file to another
3. insert your own created clip into a sound file
4. edit the sound file clip index
With (3), you can insert any 4 bit IMA ADPCM clip into a PS2 or PS3 sound file and you can insert any 24 bit big endian signed PCM clip into a PS3 sound file. You can create those types of clips using freely available tools (I used Audacity and Sox - links to these on my web page).
Great news!!
So with say like using Audacity can we equalize the random sound clips?
Very cool Mark, nice work!
This is a really nice program, can't wait to try the new version. Your work great and is also appreciated! Thanks again for all your efforts.
Casey Jones2 posted:So with say like using Audacity can we equalize the random sound clips?
I'm not sure what you mean. If you have mp3, wav or many other types of sounds, you can read them into Audacity. You can adjust their sample rates to the 5512 Hz or11025 Hz rates supported by the engines (monophonic only). Then you can export them to raw data files. Then you need to use Sox to convert those files into clips, playable by the engines, that my program can stuff into the sound files.
Audacity can generate 4 bit VOX ADPCM clips - but you need Sox to convert those to 4 bit IMA ADPCM clips.
Audacity can generate 24 bit little endian signed PCM clips - but you need Sox to convert those to 24 bit big endian signed PCM clips.
It may be that the clips were originally created on Apple computers rather than Intel PCs. Commands for those conversions are on my web page.
Maybe you can find an sound editor program than can generate these needed formats directly.
Any special things you need to install for SOX? I see it's actually a command line program, and the reviews on SourceForge say something about not coming with the DLL's required.
Now this could be fun
gunrunnerjohn posted:Any special things you need to install for SOX? I see it's actually a command line program, and the reviews on SourceForge say something about not coming with the DLL's required.
I just installed it from *.exe file on their web page. I believe that the DLL missing are if you want to generate mp3 files. We are just using sox to manipulate 4bit and 24 bit raw data files.
Am I missing something, or is it a plain command line application?
gunrunnerjohn posted:Am I missing something, or is it a plain command line application?
Yes, its a plain command line app. The .exe that you download, though, is an installation program. It puts the program and some required DLL's into your Program Files folder. Then its executed via command line from there.
On my computer (Win 7), the sox program is put into its folder and is executed with a command line like this:
"C:\Program Files (x86)\sox-14-4-2\sox" -r 11025 "farm sounds 11025 4b.vox" -e ima-adpcm -c 1 "farm sounds 11025 4b.ima"
Sounds right, what does wget.exe do?
gunrunnerjohn posted:Sounds right, what does wget.exe do?
I don't know. I only learned enough about the sox program so I could do the sound format conversions.
wget is a command line url resolver/retriever program.
SanDiegoMark posted:gunrunnerjohn posted:Sounds right, what does wget.exe do?
I don't know. I only learned enough about the sox program so I could do the sound format conversions.
Fair enough, I didn't see any documentation on it..
Severn posted:wget is a command line url resolver/retriever program.
HUH? Is English your first language?
I did go look it up, but I don't know why it was included with the SoX application.
I found this in a readme/notes area from some time back --
-wget ----- - -SoX can make use of the wget command line utility to load files over -the internet. A binary copy of wget has been included with this -package of SoX for your convience.
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!
-Sam
Sam,
I'm happy the program helped you out. Thanks for the hint about piping directly to sox. Exporting to vox always worked for me.
Mark
This program is awesome! I used it to switch a bell in my Texas Special, the original bell sounded like a wrench hitting a pipe, I found a bell from another diesel and swapped it in no problem, the next step is to load it on to the engine! Thanks for your time and effort into making this program!
Yet another version, V1.3.0, of ADPCM can be downloaded from my web page.
http://www.silogic.com/trains/ADPCM.html
This new version allows you to add sounds to empty index locations in the sound file. Those of you who have been around for a while know that the Xing Signal (SXS) was added late in the life of PS2. Many earlier engines don't have this sound.
My 20-3163-1 P&LE 2-8-0 H9 (from 2005) was one of these. Since I didn't like the whistle and bell sounds in this engine I replaced those with sounds from a 20-3372-1 4-8-2 L-3a Mohawk (from 2009). The Mohawk had a Xing Signal so I fixed up ADPCM to be able to add a completely new sound into an empty index. The Xing Signal is in index location 42 so I added the Mohawk's Xing Signal sound into that location.
Since I discovered where the soft keys are stored in the sound file, I turned on the appropriate bit for the SXS soft key. I loaded this sound file into my H9, deleted the engine from the remote and added it back. The SXS soft key was there. All of the inserted Mohawk whistle and bell sounds were there and the SXS soft key played the Xing Signal.
With my RTC program, you can play any sound from 1-255 with the press of a button. You could insert sounds in any empty index location and play that sound. You would have to use the RTC program, though, as the remote does not have a way to command these new sounds to play.
Brilliant, thank you! I have been working on converting my MTH 4-6-0 George Washington to WDRR Walter E Disney, but was relying on Protocast for the Disneyworld Park announcements.. this will be perfect to add in the real sounds.
metsno1fan posted:Brilliant, thank you! I have been working on converting my MTH 4-6-0 George Washington to WDRR Walter E Disney, but was relying on Protocast for the Disneyworld Park announcements.. this will be perfect to add in the real sounds.
I'd suggest that you put the new sounds into indexes 177-186. The sounds in these locations play when you press the S01 to S10 soft keys.
What happens to the sounds that currently occupy S01 to S10? Those are a lot of the common sounds on most locomotives, they're not empty spaces.
gunrunnerjohn posted:What happens to the sounds that currently occupy S01 to S10? Those are a lot of the common sounds on most locomotives, they're not empty spaces.
In metsno1fan's case, I figured that he was re-incarnating his engine to a new life so the S01-S10 sounds could be replaced with more appropriate ones.
OK, I can see that. Just checking...