Recording raw audio, and encoding it later

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

 



I would like to capture raw audio, chew on it with my own code, then save the result into some common format, such as wav or mp3. I'm trying to understand the description of sample formats given in the arecord man page:

      -f --format=FORMAT
             Sample format
             Recognized sample formats are: S8 U8 S16_LE S16_BE U16_LE U16_BE

So, if I understand the man page correctly, then if I run "arecord -t raw -c 1 -f U16_LE -r 8000", then the resulting file will have, basically, raw 16 bit samples, mono, 8000 samples per second, is this correct?

Then, after my processing the raw data, my plan was to use "sox -b 16 -e unsigned-integer filename.raw -o filename.wav" to create a WAV file, am I on the right track? One thing I was not sure of is that sox's man page says that for "-e unsigned-integer" this means that "value of 0 represents maximum signal power". Is this what arecord's "-f U16_LE" produces; I take it that this means that the value of 0x0001 would be the minimum signal power, silence, then increasing up to 0xFFFF, then 0x0000 for the maximum signal power, correct?

What I'm basically trying to do is take an audio sample of some length, then split it into multiple files when there's silence in the audio, with some minimum durations of each file. If there's already some useful tool that can do this for me, I'd like to know, but if not I figure that I can use this approach to try some heuristics to find short stretches of silence in the raw audio, taking into account some background noise.

Attachment: pgpSN0OQFO76x.pgp
Description: PGP signature

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux