ashishbajaj99 / mic

A simple stream wrapper for arecord (Linux (including Raspbian)) and sox (Mac, Windows). Returns a Passthrough stream object so that stream control like pause(), resume(), pipe(), etc. are all available.
MIT License
103 stars 61 forks source link

Mic on windows ignores bitwidth setting #40

Open UCABJDP opened 4 years ago

UCABJDP commented 4 years ago

Hi, when using this module on Windows, the audio stream seems to ignore the settings given, and instead pipes out 32 bit PCM audio no matter what. To test I streamed audio from the mic module into a file, and played the resulting file in VLC, where the codec information states it's 32bit Signed LE PCM audio.

Reading the documentation appears to show this is intentional: -p is an alias for -t sox -, which sets the file format to .sox, which is 32bit PCM audio. Viewing the resultant file in a hex editor confirms it's a .sox file as it has a default comment of "Processed by sox" (or wtte) http://sox.sourceforge.net/sox.html#FILENAMES (see: -p and -t) http://sox.sourceforge.net/soxformat.html (see .sox)

lexasss commented 1 year ago

Hi. It seems that this issue persists in 2022.