Using Sound eXchange (SoX) for Audio Postprocessing with DiaStar

From ProjectDiaStar

Jump to: navigation, search

Sound eXchange Introduction

http://sox.sourceforge.net/Main/HomePage

Building SoX

Before building Sox itself, two GPL libraries are needed for MP3 support:

MAD - MAD is a high-quality MPEG audio decoder.

Build/install MAD with:

# ./configure
# make
# make install

Lame - LAME is a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL.

Build/Install lame with:

# ./configure
# make
# make install

Once these are installed, Sox can be built from source:

# ./configure
# make
# make install

When done, SoX should indicate it supports mp3:

# sox -h 

AUDIO FILE FORMATS listing will include mp3.

Once an mp3-compatible SoX is build, an mp3 file playable by DiaStar can be easily produced. The usual audio format for DiaStar multimedia is linear PCM, 8 Khz sampling, 16 bit, mono. For example:

# sox input_file.mp3 -t raw -r 8000 -s -2 -c 1 output_file.pcm

Keep in mind that, when played with an independent video file, there will be no synchronization information. At a minimum, the files need to be timed so that they run out simultaneously.