On Mon, Feb 23, 2009 at 07:58:22AM -0800, J.C. Roberts wrote:
> On Mon, 23 Feb 2009 13:35:14 +0100 Alexandre Ratchov <a...@caoua.org>
> wrote:
> 
> > aucat records 1-channel, s16le at 16kHz (required by the device)
> > then it converts it to 2-channel, s16le at 44.1kHz (required by -o
> > defaults) and saves the result. So it appears to work.
> > 
> > You probably want to record as follows:
> > 
> > aucat -f /dev/audio1 -C 0:0 -e s16le -r 16000 -o out-wcam-plain.raw
> > 
> > and then to play it:
> > 
> > aucat -c 0:0 -e s16le -r 16000 -i out-wcam-plain.raw
> > 
> > Let me know if above commands properly work on current (they should
> > work even on few months old -current system, but iirc not on 4.4)
> > 
> 
> Unfortunately, the above doesn't work in 4.5-current, and the debug
> output has been changed somewhat. One of the things I did notice is the
> resampling from 16000Hz to 44100Hz does not seem to be occurring in
> 4.5-current.
> 
that's the desired behaviour; the resulting file will be at 16kHz,
which is the device native sample rate.

> $ aucat -C 0:0 -e s16le -r 16000 -f /dev/audio1 -o test45.raw
...
> dev_init: hw recording s16le,0:0,16000Hz
                         ^^^^^^^^^^^^^^^^^
the device is using s16le,0:0,16000Hz, and there are no conversion
layers so the file should contain the signal as-is.

> 
> $ aucat -c 0:0 -e s16le -i test45.raw                                 

the ``-r 16000'' option is missing, so aucat will thing
that ``test45.raw'' is using the default rate of 44100Hz,
and it will play it too fast.

>  
> You may also want to note that by defining the rate (-r) as 16000Hz in
> the playback still results in it playing too fast and with distortion,
> albeit slower than playing it as above at 44100Hz. 

that's bad. Perhaps a bug in the uaudio(4) driver. Could you send
me off-list the recorded file (preferably with some voice or music)
and the exact command to generate it so i can analyze it?

> From the debug output
> on the recording, it seems the file is supposed to be saved at 16000Hz,
> but on playback, you have the force the rate down to about 8000Hz for
> the timing to seem correct (i.e. normal speech speed, but there is also
> plenty of distortion).
> 
> I still think the issue has something to do with the new resampling
> (rate change) code that allows aucat in server mode (-l) to handle
> anything you toss at it. If I'm reading the debug output correctly,
> the old 4.4-stable aucat resampled from 16000Hz up to 44100Hz, but the
> 4.5-current aucat is not resampling the input at all during recording?
> 

yeah, that's one possibility. But during recording aucat didn't
make any conversions, it should have worked. hmm.

-- Alexandre

Reply via email to