0

I want to write a Python script that continuously records audio from an input source (this Python program will be running 24/7). Much of the time, the audio input will be silent, but maybe two or three times a day there will be several distinct periods of 30 minutes to an hour where there will be a mostly continuous stream of audio (maybe there are 10 to 60 second gaps of silence at most within each "continuous" period).

I'm considering using some type of moving averages to figure out how to find the endpoints. For example, determine when a longer moving average falls below a given threshold and then use the nearest occurrence of a much shorter term moving average falling below the threshold to determine the endpoint. To find the start, I could the first occurrence of a shorter term moving average surpassing a high threshold where a longer term moving average has surpassed a lower threshold.

Is this the approach you would take to implement something like this? Or is there a better way?

joejoejoejoe4
  • 1,206
  • 1
  • 18
  • 38

0 Answers0