How can we identify silence packet in a byte array (Buffer provided by WaveInEventArgs) using Naudio. basically I am trying to loop through the array and checking for 0 values in the array. Is that correct?
Asked
Active
Viewed 1,798 times
1
-
1Without knowing naudio I would say that 0 values may be rare. You most likely will have to define a threshold value which is then used to detect "silence" e.g. values below the threshold. Probably naudio does that already for you but be aware silence is very subjective and depending on the source may mean different things. – Samuel Jun 04 '14 at 13:04
-
Here's a basic implementation for [detecting silence duration using NAudio](https://stackoverflow.com/a/46024371/4934172). – 41686d6564 stands w. Palestine Sep 03 '17 at 14:29
1 Answers
3
I'm not sure what you mean by "packet", but finding silence is usually a matter of looking for consecutive samples having an absolute value less than a "threshold" amount. 0.00006 is -84.437 dB, so silence detection can be done on most audio with that value (though you should feel free to adjust that threshold to fit your audio). Depending on exactly what you are doing, you'll want to see a sequence of anywhere from 440 to 48000 "silent" samples before deciding it's a silent "packet".

ioctlLR
- 1,217
- 6
- 13