2

I am tying to do silence detection in uncompressed AIFF audio files. I prefer to do it in Python, but would consider other options if this is super inefficient. The uncompressed files I am dealing with are expected to be 20 MB (maximum size).

I can understand basics of signal processing, but am not an expert in it.

chv
  • 23
  • 3

2 Answers2

1

You're in luck! The aifc library seems to do enough to support the solving of your problem.

Joe
  • 46,419
  • 33
  • 155
  • 245
0

Language-agnostic pseudo code:

  • for each time window (e.g. 10 ms)
    • calculate RMS power in time window
    • silence = RMS power < silence threshold

To calculate RMS power:

  • sum_sq = 0
  • for each sample in N sample window
    • sum_sq += sample^2
  • RMS power = sqrt(sum_sq / N)

You probably also want to add a further layer of detection, e.g. decide that silence = M consecutive silent windows, where M determines how long a silence needs to be before it counts as an actual silence.

Paul R
  • 208,748
  • 37
  • 389
  • 560
  • Let me try this. With afic library, I can read a frame at a time (don't think I can read raw bytes) and compute RMS and do the rest. – chv Jan 21 '11 at 15:04