arecord | split to wav or ogg

219 Views Asked by At

I have the following script on linux:

arecord -t raw -f S16_LE -r 44100  -c 1 | split -d -b 882000 --filter='flac - -f --endian little --sign signed --channels 1 --bps 2  --sample-rate 44100 -s -o "${FILE}.flac"'

this script records audio at 44100 fs, 1 channel, then flac files with 882000 bytes, ie 10 seconds of audio at 44100 sample rate are created and saved. The audios are 2 mb, is there any way I can do this but save it in wav or ogg format? Flac files, not having loss, take up a lot of memory space, I want to reduce that with another format

1

There are 1 best solutions below

0
Yuri Sitnikov On

You can use lame instead flac:

arecord -t raw -f S16_LE -r 44100  -c 1 | split -d -b 882000 --filter='lame -r -s 44.1 - "${FILE}.mp3"'