25 from scipy.io
import wavfile
42 if not os.path.isfile(audio_file):
44 samp_freq, signal = wavfile.read(audio_file)
45 sq_signal = signal * 1.0
46 for i
in range(0, len(sq_signal)):
47 sq_signal[i] *= sq_signal[i]
48 mean_sq = mean(sq_signal)
49 std_sq =
std(sq_signal)
50 rsd_sq = std_sq / mean_sq
52 if rsd_sq > threshold:
56 return [rsd_sq, has_silence]
Performs silence detection on an audio file.
def detectSilence
Detects silence.