Log in

View Full Version : Detect silence?


ChiDragon
24th March 2007, 20:21
Can someone please shed some light on how I might detect a frame as having silent audio? Is it even possible to do so for a DVD/capture file?

I've tried finding the average value of all the samples for a frame, but they appear to jump all over the place regardless of sound level for actual files. Silence generated by Tone appears as "0" though, so is there some sort of sub-audible noise messing with the numbers? AudioGraph manages to show a straight line...

Leak
25th March 2007, 12:22
AudioGraph manages to show a straight line...
You might want to filter out all frequencies below ~20 Hz (highpass filter) as well as all values that are very close to 0 (noise gate); if the audio was recorded as opposed to generated it's sure to contain a tiny bit of noise that messes up your calculations, and lossless compression probably adds a bit of noise on it's own...

As for audiograph showing a straight line - well, 16-bit audio values can range from -32768 to +32767 and if the graph has a height of (say) 480 pixels values from -34 to +34 will go unnoticed if AudioGraph uses rounding...

np: Alias & Tarsier - 9:24 Cigarette (Version 1) (Plane That Draws A White Line)

ChiDragon
26th March 2007, 11:37
Thanks for the suggestions. The trouble was actually that I was using 16-bit calculations for float audio! I had assumed that NicAudio outputted 16-bit. I figured the trouble was me doing something stupid like that...

I'm also using the highest sample value for a frame now instead of the average. Seems to be working nicely so far.