0
101 Apr 09, 2008 at 11:11

We are going to develop a train simulator for the education of machinist candidates. The simulator will be realistic like the real train, with all of its features. Hence, we need the sounds to be heard by the machinist like driving the real train. We are planning to collect the real train sounds on the train and use FMOD library to provide the sounds.
But we don’t know in which format to collect the sounds. When choosing the sound format to use in our project, we should take into some considerations (such as quality, size, loading time, etc.).
Which format is suitable for this purpose (.wav, .mp3, etc.)? What are the advantages and disadvantages of the sound formats?
I will be appreciated if you help me…

Thanks

#### 16 Replies

0
175 Apr 09, 2008 at 12:19

You should keep all original samples in a lossless format like WAV. It’s also the most widely supported. Now if you want, you can make compressed versions of those wavs in either mp3 or ogg format for your simulator. These are the two most popular formats. The quality loss is negligible at bitrates of 128kb or higher and will be better to stream from if you have music or long audio streams playing.

0
101 Apr 09, 2008 at 14:54

Isn’t mp3 patented? IIRC, you could face lawsuits if you use it without paying/permission…

0
101 Apr 09, 2008 at 15:01

@Kenneth Gorking

Isn’t mp3 patented? IIRC, you could face lawsuits if you use it without paying/permission…

IIRC the decoder is free, but the encoder isn’t. But this is definitely something worth looking into, so don’t blindly trust my words on this :). Or, you could avoid all the hassle and simply use Ogg, which is public domain.

0
165 Apr 09, 2008 at 15:43

I’m not sure exactly what patent restrictions there are on MP3, but I’m pretty sure they don’t even prevent you from encoding to it, otherwise projects like LAME couldn’t exist…

0
101 Apr 09, 2008 at 16:08

Projects like LAME are merely source code for educational purposes. Why do you think there are no binaries to be found on the website? :)

From the LAME website:

LAME is an educational tool to be used for learning about MP3 encoding. The goal of the LAME project is to use the open source model to improve the psycho acoustics, noise shaping and speed of MP3. LAME is not for everyone - it is distributed as source code only and requires the ability to use a C compiler. However, many popular ripping and encoding programs include the LAME encoding engine, see: Software which uses LAME. Using the LAME encoding engine (or other mp3 encoding technology) in your software may require a patent license in some countries.

0
101 Apr 09, 2008 at 18:18

http://www.mp3licensing.com/help/index.html

5) Do I need a license to distribute mp3, mp3PRO or mp3surround encoded content?

Yes. A license is needed for commercial (i.e., revenue-generating) use of mp3/mp3PRO in broadcast systems …

However, no license is needed for private, non-commercial activities (e.g., home-entertainment, receiving broadcasts and creating a personal music library), not generating revenue or other consideration of any kind or for entities with associated annual gross revenue less than US$100 000.00. 0 101 Apr 09, 2008 at 19:54 @Kenneth Gorking Isn’t mp3 patented? IIRC, you could face lawsuits if you use it without paying/permission… There are patents, but if you use the operation systems function to decompress the mp3 files you’re out of the loop (at least that’s what I’ve been told last time I checked the issue). Otoh decoding ogg-files is much simpler and it’s a self-contained library that you can link to your progream. You will never run into the problem that the someone dickhead runs your application on a system where the mp3 decoder has been deinstalled or stuff like that. Nils 0 101 Apr 09, 2008 at 19:57 I knew I had read something concerning mp3 patent infringement; it was Microsoft who barely dodged a$1.5 billion lawsuit from Alcatel :)

0
101 Apr 09, 2008 at 20:32

I’m surprised nobody mentioned FLAC which has the same quality as a 16-bit .wav but has better compression. The files may be somewhat larger than .MP3 or .OGG since both of those formats are lossy. It seems to be the best of both worlds for what you are looking for: authentic lossless sound format but with compression.

0
101 Apr 09, 2008 at 22:16

Again you could pretty easily make your own file compression with the Python standard library. That way you could get exactly what you want and you don’t have to worry about lawsuits.

0
165 Apr 09, 2008 at 23:28

I’d recommend against that; the compressors built into Python’s standard library are just for standard generic formats like gzip and bz2. These aren’t specialized for audio and so wouldn’t achieve compression ratios or performance as good as the specialized ones like FLAC. They are also lossless and therefore can’t compress as much as a lossy format like Ogg or MP3.

0
101 Apr 10, 2008 at 01:11

I was actually refering to audioop.py, but I didn’t really think of the compression files.

0
165 Apr 10, 2008 at 01:31

That module doesn’t have any compression support except for very simple delta encoding. And I don’t think you’d really want to roll your own audio compressor from scratch. :)

0
101 Apr 10, 2008 at 02:41

True, but I bet some person out there will take that as a challenge and create the new and improved MP-Gogol.

0
101 Apr 25, 2008 at 06:58