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

added fileType parameter to arecord #25

Closed cmvee closed 6 years ago

cmvee commented 6 years ago

Added the fileType option (already defaults to raw) as a parameter that gets passed to the spawned arecord process. This resolves the issues noted in https://github.com/ashishbajaj99/mic/issues/22.

Without this parameter, arecord defaults to WAV format, which has a 2GB file size limit. In situations where a fileType has not been specified and the user wants to run arecord continuously, arecord eventually exits when it has processed 2GB worth of audio. Now, by default, the audio type will be raw (which has no file size limit), meaning that arecord will run indefinitely. For any given fileType the user supplies, the expected behavior is that arecord will run until it has processed the maximum file size amount of data for that given type.

More info on arecord is available here: https://linux.die.net/man/1/arecord

Condrat commented 6 years ago

Thank you for figuring this out! This solves a problem I was having with another project that used arecord to stream microphone input, but would die after an hour or so.