Re: sox can't encode to 16-bit

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

 



On 1/18/19 9:54 PM, Måns Rullgård wrote:
$ rec -c 2 -b 16 -r 48000 -p trim 0 20 |
sox -V3 -c 2 -b 16 -r 48000 -p test.wav trim 0 10 : newfile : restart

I want to record 16-bit wav files, but the files generated are 32-bit ones.

Put the "-b 16" option immediately before the output file argument.  You
can also drop all the format options preceding the -p since the pipe
format already includes all information.

$ rec -c 2 -r 48000 -b 16 -p trim 0 20 | sox -p test.wav trim 0 10 : newfile : restart
rec WARN formats: sox can't encode to 16-bit

Input File     : 'default' (alsa)
Channels       : 2
Sample Rate    : 48000
Precision      : 16-bit
Sample Encoding: 16-bit Signed Integer PCM

In:0.00% 00:00:20.05 [00:00:00.00] Out:960k  [   ===|===   ] Hd:5.0 Clip:0
Done.

$ soxi  test00*.wav

Input File     : 'test001.wav'
Channels       : 2
Sample Rate    : 48000
Precision      : 32-bit
Duration       : 00:00:10.00 = 480000 samples ~ 750 CDDA sectors
File Size      : 3.84M
Bit Rate       : 3.07M
Sample Encoding: 32-bit Signed Integer PCM


Input File     : 'test002.wav'
Channels       : 2
Sample Rate    : 48000
Precision      : 32-bit
Duration       : 00:00:10.00 = 480000 samples ~ 750 CDDA sectors
File Size      : 3.84M
Bit Rate       : 3.07M
Sample Encoding: 32-bit Signed Integer PCM

Total Duration of 2 files: 00:00:20.00

Is the position of "-b 16" option okay?

That said, why don't you do the splitting directly with the rec command?
This should work:

$ rec -c 2 -b 16 -r 48000 test.wav trim 0 10 : newfile : restart

I understand it, but I have to save test.wav first.
I just want to split into wav files while I record from the line input.

Regards,
--
Toru Yagi
yagitohru@xxxxxxxxxxx


_______________________________________________
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