Re: Several beginner q's about Sox encoding (mp3/aac)?

Erich Eckner <[email protected]>
Newsgroups gmane.comp.audio.sox
Message-ID <[email protected]>
Hi,

> I have a Raspberry Pi running Debian Jessie, as well as a MEMS I2S mic and
> a Pi Camera. My mic records 32bit raw PCM audio. I am trying to stream
> video and audio to Youtube Live. I am using Sox for audio recording and
> encoding.

I doubt, your microphone really records 32 bit (even more expensive
equipment usually records 24 bit "only"). The data stream is 32 bit (as
is sox' internal stream), but the actual data is only less - maybe 24 or
16 bit.

> YouTube Live only accepts mp3 or aac encoded audio.
> 
> I have installed sudo apt-get install libsox-fmt-mp3, so my Sox is able to
> encode mp3.
> 
> I am using this command to record and encode audio:
> 
> rec --buffer 2000000 -c 1 -r 44100 -b 32 test.mp3
> 
> /usr/bin/rec WARN formats: mp3 can't encode to 32-bit
> 
> Input File     : 'mic_mono' (alsa)
> 
> Channels       : 1
> 
> Sample Rate    : 44100
> 
> Precision      : 32-bit
> 
> Sample Encoding: 32-bit Signed Integer PCM
> -------
> 1. I get the warning: " mp3 can't encode to 32-bit" - what should I do
> about this?

Some settings can't be encoded into mp3. In the past I've hit the limit
for sample rate (48k) - it seems, the bit depth is also limited.
Try reducing it to a sane value (see above).

> 2. My resultant MP3 file has small clicks and popping noises throughout. I
> know this is not a problem with my mic, as I've produced AAC encoded audio
> with FFMPEG that was perfectly clean. Any idea why this is happening?

This is probably due to a slow cpu / computing intensive encoding. I had
same issue with an old laptop and some other recording tool, when
recording to mp3, but not to wav.
I'm not sure how to circumvent this. Probably a Raspi is too slow at all?

> 3. Is it possible to compile SOX with AAC encoding support? I want to try
> AAC encoding to see if that eliminates the clicks and pops.

I have no idea about this, but maybe it's possible.

Regards,
Erich

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot

_______________________________________________
Sox-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sox-users
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE3p92iMrPBP64GmxZCu7JB1Xae1oFAlir1bIACgkQCu7JB1Xa
e1oOphAAsRQzq2fFaVH4rGG4tBEnt2eBqwxCO8l/tlK01HCl8EmMICqsZNv72N6R
TgNUFjYaGKkS3dDdsViHz+pcot59G80mi+soHl4oduUq6me5ShmzMIVPneA2fG/s
2PHlRfwHDr1gOssEBZec4Y8HGkgbEA8x7uvSTjM9sfymP8C3nAlntyWXHWG+RGrE
Ge4iVvhuV22JPtCEgBAjNY+ueLwsSkC5wWANuI6Ve/lpuDZsdJiIePbIxMRG6t53
9cdaOArdqGbqHE1EFRs8wcd4xePJCKzCuRVKtNvbDAqKl7SwY0tLGtM632jNclik
AgjutvUsRQ8/hA6XVKt81uhy/Bt5nQCdO1Zf9X9Hx5CWRUj6Qyx6d05C8BHBxH6i
21cGHhdDuk4N/uRXq3lMK86OjdxCcPRLsSZosyiRqoJUJXNQ3TyfVAev0fSgLL7Q
REszNwCfPKrfJVrCZVFMjVLWQdwuRdz+6W0KrNzbcrbSLKEJjw9ObGn38I+ENl9T
B8sbX9zlzvuiIfnpFw5/8vALYR1XIpyVmykzj9+Gw2nhZOFGzeMfNagTdskQIdNj
ycTiVY5q2ItK8f+hQifbvUfYAD0bPuYYVk5XzcPbCVGrgMiItTb1JoWy9yDa1tlL
io2odOZAVAZmOrJc5/r0YJ7GppiOGAdSAtPl7L9NaQm2/I2/osw=
=bULx
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.