Re: [solved] Convert multichannel raw file to wav

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

 



On Apr 23 07:58:33, rodolfo.medina@xxxxxxxxx wrote:
> Jan Stary <hans@xxxxxxxx> writes:
> 
> >>  $ pacat --record -d
> >> alsa_input.usb-BEHRINGER_UMC404HD_192k-00.analog-surround-40 --channels=4
> >> --channel-map=aux0,aux1,aux2,aux3 --file-format=wav dump.wav
> >> 
> >>  Warning: failed to write channel map to file.
> >>
> >> and in fact the resulting file seems not to be as accurate as the one I get
> >> creating first the raw file and then converting it to wav via sox.
> >
> > In what way is the converted file more "accurate"?
> 
> We have now two different methods to produce the wav 4-channel audio file: the
> first we call output2.wav we got with:
> 
>  $ pacat --record -d alsa_input.usb-BEHRINGER_UMC404HD_192k-00.analog-surround-40 --channels=4 --channel-map=aux0,aux1,aux2,aux3 > dump2.raw
> 
>  $ sox -t raw -r 44100 -e signed-integer -L -b 16 -c 4 dump2.raw output2.wav
> 
> and the second we call dump.wav simply with:
> 
>  $ pacat --record -d alsa_input.usb-BEHRINGER_UMC404HD_192k-00.analog-surround-40 --channels=4 --channel-map=aux0,aux1,aux2,aux3 --file-format=wav dump.wav

Do you know that what pacat produces is actualy 16bit unsigned integers
at 44100? If so, why don't you say so explicitly, leaving that as an
artifact, when you need to rely on that later?

> Now, using sox I split each of them in four single channels and observe,
> or hear, that in the first method those single channels are better separate:
> I can say so because one of my microphones is an ugly 6-dollar bad thing
> I bought just for experiment and I can recognize it: it's a sensation
> but very clear but difficult here to explain:

Neither SoX nor pacat have no relation over to microphone.
They are fed a sequence of numbers, whatever the numbers are,

Also, your (converted) output2.wav and the (recorded) dump.wav
are two different recordings of two different signals.
There is nothing to compare here.

> however pacat alerts us with its message:
>  Warning: failed to write channel map to file.

I very much doubt that has anything to do with your
"unexplaineble sensation", but let's try: what exactly
does that message mean? What is a channel map?
Did SoX write the channel map into the wav file?

> so the second methods is not good unless we manage to eliminate that message,
> but the first method seems very good with just one step more.

I don't use pacat, but I assure you it does exactly the same thing
when it records a wav file as when it records a raw file, besides
slaping some 44 bytes of a header onto it. Similarly, SoX does
nothing with the actual audio data when converting the raw file
into a wav file, or when separating the channels: the extracted
channel is exactly the same sequence of numbers.

At any rate, you have your answer: yes, sox will convert to any
target format, if you know what the source format is.



_______________________________________________
Sox-users mailing list
Sox-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/sox-users



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux