I was wondering (I've had a look around and can't see anything immediately) if it was possible to create something that can analyze a .wav file to see if it is completely silent or contains any noise/voice at all. I'd need my program to listen to a .wav file through a player which is ran inside a web page. It would be possible to extract the .wav if absolute necessary but this function/macro will be analyzing hundreds (possibly thousands of .wavs a week so want to avoid having to extract at all.
Apologies if this has already been asked somewhere else but I really couldn't find anything.
I'm not quite sure how to load the hex into a variable and analyze with qm, but silent is all zeros where noise has values assigned. The forum won't let me upload the .wav files I used.
;Read in data from wav files str s1.getfile(wavFile1) str s2.getfile(wavFile2)
;Convert binary data to string array, just extract 50 bytes only. ARRAY(str) a1 a2 sub.GetDataFile(s1 50 a1) sub.GetDataFile(s2 50 a2)
;Check for silent wavFile1 int result=sub.CheckSilentWav(a1) if(result)outF"{wavFile1} is silent." elseif(result=0)outF"{wavFile1} is noisy." elseoutF"Unknown {wavFile1} file."
;Check for silent wavFile2
result=sub.CheckSilentWav(a2) if(result)outF"{wavFile2} is silent." elseif(result=0)outF"{wavFile2} is noisy." elseoutF"Unknown {wavFile2} file."
#sub CheckSilentWav function#ARRAY(str)&wav ;Note1: return 1 if wav file is silent; return 0 if wav file is noisy; otherwise return -1. ;Note2: just check the value from 44th to 50th position (7 bytes only) to find out if it is silence or not. if wav.len>0 ,for _i 4350 ,,if(!(StrCompare(wav[_i],"00")=0))ret0 ,ret1 else ,ret-1