Hi,
Is there a way i can know after the RECORD function is completed if the recording is silent or is not human talk something like AMD?
Hi,
Is there a way i can know after the RECORD function is completed if the recording is silent or is not human talk something like AMD?
Or can i check the file with a linux command?
You can check the file offline, but there probably won’t be a standard Linux command.
Can i do it with sox?
The file size of an empty WAV file is 44 bytes – the size of the WAV header.
I use this in a shell script to detect voicemail recordings I’m not interested in:
threshold=40000
max=$(sudo sox ${file} --null stat 2>&1 | awk '/Maximum amplitude:/ {printf "%d\n", $3 * 1000000}')
if [ ${threshold} -gt ${max} ]
then
.
.
.
What are you looking for in your voicemail files?
Basically anything above silence and background noise.
What is Maximum amplitude?
Loosely ‘volume’ – how loud.
What is the level of human talk? i need talk that is 2 seconds too
Did you test it and came to the conclusion that less than 4000 is not human?
The 40k threshold seems to work for me.
Thanks i will test it
The number of seconds or the number of samples output by sox may also be of interest.
I’ve seen other posts mention RMS what is that?
Also whey do you use Maximum and not Midline?
I won’t pretend I understand it Root Mean Square
Max seemed to give me the result I was interested in. I’m not an expert, just a user.
You might be able to create a file with silence stripped using sox and see if that had a zero payload length.
The file size of an empty WAV file is 44 bytes – the size of the WAV header.
I use this in a shell script to detect voicemail recordings I’m not interested in:
threshold=40000
max=$(sudo sox ${file} --null stat 2>&1 | awk '/Maximum amplitude:/ {printf "%d\n", $3 * 1000000}')
if [ ${threshold} -gt ${max} ]
then
.
.
.
How can i execute this from fastagi?
I tried Eexc("Set","amp=${SHELL(sox filename.wav -n stat 2>&1 | awk '/Maximum amplitude:/ {printf \"\" % d\\n\"\", $3 * 1000000}')}")
and it didn’t work it set the variable with the text
In no particular order…