Skip to main content

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.

Original Post

Replies sorted oldest to newest

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

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

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).

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.

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.

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"

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

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.

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.

Add Reply

Post
The DCS Forum is sponsored by

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
Link copied to your clipboard.
×
×