[linux-audio-user] Lower Output Level after Mono to Stereo Conversion with SOX

Martin McCormick martin at dc.cis.okstate.edu
Tue Jun 8 22:54:19 EDT 2004


	I recorded a mono .wav file at 14400 samples per second and it
sounds loud and clear.  Then, I got fancy and decided to convert it in
to a stereo file suitable for putting on a CD.  It still sounds clear,
but about 3DB down from the original mono recording.  Just guessing at
this, but it is noticeably lower in volume.
Here's how I did all that:

#! /bin/sh
arecord -d 454 -t wav -r 44100 -c 1 -f S16_LE \
| sox -t .wav -c 1 - -c 2 -w -r44100 outputcd.wav

	The top half of that shell script originally outputted to a
file which was mono and did play at 44100 samples/sec.

	If I take that file and use it as input to the lower half of
the script, I get exactly the same lower audio level so I know it
isn't the way I am piping the arecord output in to sox.  Besides, that
is normal UNIX practice and there is no modification to the data.

	I expected sox to simply duplicate the mono data in to both
left and right channels.  Is this normal or do I need to tell sox to
increase the level.  I may accidentally be causing sox to expect
another channel of audio which would be right if one was mixing two
channels.  In this case, 100% of the mono signal should appear on both
channels as if I had a Y connector.

	Sox is amazing in that I was able to produce a CD-ready audio
track from some unsigned 8-bit PCM audio and it sounded as good as it
did originally.  This isn't all that good for anything but voice, but
the conversion didn't make it any worse.  For those who are curious,
that script looks like:

#! /bin/sh
sox -t ub voxaudio.ub -t wav -c 2 -w -r44100 output.wav resample .95

	I don't have any particular question about this script, but I
do wonder why my mono/stereo conversion is a few DB down?

	Thank you.

Martin McCormick WB5AGZ  Stillwater, OK 
OSU Information Technology Division Network Operations Group



More information about the Linux-audio-user mailing list