I know so many topics have talked about silence detection, but I didn't find something that meets what I really need.
I'm working on an asterisk project, for inbound calls being recorded for the first 10 sec and saved in a directory with a unique id name (root/recordings/unique-id.wav)
# How should it work:
1- asterisk inbound call
2- recording the first 10 sec of that call
3- saving the recorded Wav files unique-id.wav
4- running the python script (silence_detect.py)
------------- inside the script -------------
// just a sample of what it would look like//
grab audio file (unique-id.wav)
audio = unique-id.wav
if audio has sound in it
print: not empty
else if
print empty
5- result: empty or not empty
# What i have:
-I have asterisk set up and running -inbound call works fine and goes through a dialplan -call getting recorded for the first 10 sec and saved as wav file in a directory
# What I need:
a simple python script to detect silence or sound in a wave file, and print the result as empty or not empty. the script should be able to grab the audio.wav as a unique file, I don't want to get into a problem where the script would detect all the wave files in this directory. I want the detection and results to be applied on each call separated.
# My Specs:
os: ubuntu server 18.04 LTS bionic
8gb ram
i5 CPU
1TB