0

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 
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Freegs Box
  • 11
  • 1
  • Hi, you can probably enhance one of the answers as suggested here (https://stackoverflow.com/questions/45526996/split-audio-files-using-silence-detection) to suit your use-case! – return007 Mar 02 '21 at 13:14

1 Answers1

-1

There is no need do that in python script if you are using asterisk.

Just use denoise and silence detect inside asterisk.

https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Function_TALK_DETECT

Or WaitForSilence.

arheops
  • 15,544
  • 1
  • 21
  • 27