[linux-audio-user] Wave file conversion (multi-mono->stereo, then downsample/downsize, then dither)

Mark Knecht markknecht at comcast.net
Thu Sep 9 16:22:45 EDT 2004


On Thu, 2004-09-09 at 12:32, Eric Dantan Rzewnicki wrote:
> On Thu, Sep 09, 2004 at 11:21:35AM -0700, Mark Knecht wrote:
> > On Thu, 2004-09-09 at 11:02, Eric Dantan Rzewnicki wrote:
> > > ecasound!
> > > ecasound -a:1 -i:mono1.wav \
> > >     -a:2 -i:mono2.wav \
> > >     -a:1,2 -f:24,2,96000 -o:stereo.wav \
> > >     -a:2 -erc:1,2 -eac:0,1
> > > Do that all on one line. The returns are escaped to make it easier to
> > > read. This creates 2 chains, one for each input mono wav file. Both
> > > chains are connected to the same output file. You have to set the format
> > > for the output because ecasound defaults to 16,2,44100. You don't need
> > > to set the format for the inputs if they are .wavs because ecasound will
> > > read the info from the wav headers. Then for chain 2 you route channel 
> > > one to channel two (-erc:1,2), and mute channel 1 (-eac:0,1).
> > > -ERic Rz.
> > Thanks. I'll give that a try. At least that handles step one, assuming
> > no audio problems are created.
> 
> If step 2 was downsampling to 16 bit 44.1kHz, then just change the -f
> above to: -f:16,2,44100 ... sorry I missed that bit.
> 
> The internal sample rate conversion is linear interpolation, I think,
> which works ok. But, if you have libsamplerate installed ecasound can 
> use that instead for higher quality conversion. libsamplerate support is
> enabled at ./configure time. I always install ecasound from source, so 
> I'm not sure how the various distros compile and package it. I suppose 
> on one of your gentoo boxes that should be no problem.
> 
> -Eric Rz.

Eric,
   I do have libsamplerate installed on my laptop here in the office.
Since all of this is just file manipulation I can do everything here and
then listen elsewhere. (Onboard sound works, but is not so good.
Interesting bass distortion problems even at VERY low levels when
playing with Jamin this morning. I hope that's not Jamin itself...)

   How would I be sure that my emerge of ecasound uses libsamplerate
capabilities? Can this be observed at runtime? Or in the output files
somehow? Anywhere else?

   Anyway, If I'm going to downsize from 24-bits to 16-bits then I want
to add dithering, but I see no mention of dithering in man ecasound. I
know jack has an option to dither it's outputs, but from some dark
remote part of my memory I seem to remember that this only effects the
output going to the sound card and not what's going to a file. Comments
anyone?

Thanks all,
Mark




More information about the Linux-audio-user mailing list