[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Swiss Army Knife of Sound has me Baffled.



Dan Ritter <dsr@randomstring.org> writes:
> > arecord: set_params:1345: Channels count non available
> > sox FAIL formats: can't open input  `-': WAVE: RIFF header not found
> 
> Keep recording 2 channels. Your hardware doesn't like it
> otherwise.
> 
> You can ask sox:
> 
> sox -t wav -c1 - -r44100 $filename
> 
> to merge the channels to a single output channel
> 
> I believe, but have not tested, that a final argument to sox of
> 
> remix 1
> 
> will get you just the left channel, or remix 2 for the right
> channel.
> 
> -dsr-

I haven't tried anything new yet but that sure looks right and
will probably work.

	Thanks to all who responded.  This is what I like about
this list as it presently exists.  I had figured out that the
problem was  with the hardware which is a fairly decent device
but severely limited in Linux because a lot of it's power comes
from a proprietary driver like a number of other devices such as
winmodems, etc.  Then I read this:

Nicolas George <george@nsup.org> writes:
> If you read carefully, you will notice that your problem is not with
> sox, it is with arecord: sox only fails because arecord fails and does
> not produce anything.
> 
> arecord itself fails because "channels count not available": the sound
> device you are using does not like mono, it obviously like only stereo.
> 
> You have two options:
> 
> - Use a sound device that supports mono. Since you cannot change your
>   hardware, it needs to be done in software with an ALSA plugin. This is
>   all streamlined, you only need to write plughw instead of hw.
> 
> - Keep recording in stereo, and have sox convert it to mono before
>   saving. You will need to peruse the manual page of sox to know the
>   option, I only ever use ffmpeg for obvious reasons.
> 
> Note that:
> 
> - If you use plughw instead of hw, then the ALSA plugin can also
>   resample, and therefore you no longer needs sox at all.
> 
> - sox is capable of recording from ALSA directly, with something like
>   "-t alsa plughw:0".
> 
> Regards,

I actually did get a message from arecord about using a plugin
and you  have answered the question as to what needs to be done
to make that happen.  I had not even thought of the plugin
solution so this is a whole new possible route to success which I didn't even
think of before.

David Wright <deblis@lionunicorn.co.uk> also writes:
> Try -r 8000, or leave out -r and -c entirely, and you should
> succeed. But I doubt that's really your priority, is it?
> 
> > […] and I
> > guess I could leave it in stereo mode and tell sox to mix the
> > left and right channels which is fine with me but kind of clunky.
> 
> That's why it's the "Swiss Army knife". After mixing the two channels,
> you can write to a single-channel WAV file.
> 
> What you can't do is tell /arecord/ to use an ADC that doesn't exist.
> 
> Cheers,
> David.

	I am in no great hurry so I will probably try both the
plugin solution and the sox coding and save them both for later
as the idea is to end up with something that is both efficient and
useful.

	Thanks, everybody.

Martin McCormick   WB5AGZ


Reply to: