Re: [linux-audio-user] Copying one channel from a Stereo File with sox

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: A list for linux audio users <linux-audio-user@...>
Date: Monday, June 28, 2004 - 12:55 am

Martin McCormick wrote:

> This appears to be right on target except I am going to need

You must mean:

arecord -d 86400 -t wav -r 8000 -f S8 -c 2 2channelarchive.wav

-f is format, -F is period time.

Why create a 2-channel file only to split them? Why not:

arecord -d 86400 -t wav -r 8000 -f S8 -c 2 -I ch1.wav ch2.wav

I see another problem. It appears that arecord is not putting a proper
WAV file header on the output file(s). That might be why sox is getting
a little confused. When you run acrecord and it says "Recording raw
data..." that's what the output file is, despite the "-t wav" argument.
If arecord says "Recording WAVE...." then your output file has a proper

Further, if you run arecord with the argument "-F S8" you really get
unsigned 8 bit output. arecord won't accept "-f S8" while "-F S8" is
silently ignored and you get unsigned 8 bit output anyway. So the
command I have above doesn't actually work, arecord says "arecord:
begin_wave:1612: Wave doesn't support S8 format...", but this works:

arecord -d 86400 -t wav -r 8000 -f U8 -c 2 -I ch1.wav ch2.wav

except that ch1.wav and ch2.wav are raw, headerless files, without WAV
headers. sox doesn't like to see raw, headerless files with names ending
in .wav, but once I rename ch1.wav and ch2.wav to ch1.raw, ch2.raw I can
use sox to put a proper WAV header on the files with:

sox -r 8000 -u -b ch1.raw ch1.wav

Alternately, arecord does create a proper 2-channel WAV file, so you
could record with this:

arecord -d 86400 -t wav -r 8000 -f U8 -c 2 twochan.wav

And then split it with:

sox twochan.wav -c 1 leftchan.wav avg -l

And your resulting leftchan.wav will be 8 bit, unsigned, 8000
sample/sec, with a proper WAV header.


Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [linux-audio-user] Copying one channel from a Stereo Fil..., wes schreiner, (Mon Jun 28, 12:55 am)