Awesome
Alsaloop
This package is responsible for detecting audio input in the HifiBerryOS system.
Requirements
The pyalsaaudio
package is used to read from and write to audio devices. This package does not work on Windows.
How it works
- The input device is opened. It is read continuously.
- When a certain number of samples have been read, the audio volume is calculated
- If the audio was not playing, but one of the samples exceed the threshold volume, audio will start playing
- If the audio was playing, but none of the samples exceed the threshold volume, audio will stop playing