filoe / cscore

An advanced audio library, written in C#. Provides tons of features. From playing/recording audio to decoding/encoding audio streams/files to processing audio data in realtime (e.g. applying custom effects during playback, create visualizations,...). The possibilities are nearly unlimited.
Other
2.15k stars 451 forks source link

Noise and silent detection #418

Open MuhamedRaafat opened 4 years ago

MuhamedRaafat commented 4 years ago

Is there any sample code or help me with idea on how to detect noise and silent in a song ??

filoe commented 4 years ago

You can process the audio through a PeakMeter and check whether the peak is below a certain limit.

MuhamedRaafat commented 4 years ago

Thanks for your helping @filoe , but by using PeakMeter i will not be able to get duration of silence or i am wrong ?

filoe commented 4 years ago

No, but you'll get the peak by the position of the stream. With that information you can calculate the time blocks which were silent and which were not.

MuhamedRaafat commented 4 years ago

Do you have any example or samples doing something like because i didn't do anything like this before or even use PeakMeter, so the idea not clear to me. Thanks in advance