Plugin.Maui.Audio icon indicating copy to clipboard operation
Plugin.Maui.Audio copied to clipboard

Silence detection

Open ArturWyszomirski opened this issue 1 year ago • 6 comments
trafficstars

Silence detection implementation for Windows and Android.

A DetectSilenceAsync should be fired after starting recording audio. The DetectSilenceAsync task is completed when silence is detected. A silence is when the recorded audio level is less or equal to silenceTreshold multiplied by noise* for silenceDuration period of time.

The SoundDetected property is set to false after each start of recording. When a sound greater than silenceTreshold multiplied by noise is detected the SoundDetected is set to true.

Most of the code is shared. The only platform specific part is the GetAudioChunk method which is responsible for providing a stream of audio data samples to the DetectSilence method.

* noise is the lowest detected audio level detected during recording but not lower than 0.01 (the values are normalized)

ArturWyszomirski avatar Apr 29 '24 14:04 ArturWyszomirski

@ArturWyszomirski thank you so much for this! We do need the iOS implementation for this to be able to merge. Lets see if someone is willing to help out or I'll see if I can have a look myself :)

jfversluis avatar May 01 '24 11:05 jfversluis

I might have some time later this month if nobody else picks it up by then I think I will 👍

FreakyAli avatar Jul 05 '24 16:07 FreakyAli

@FreakyAli that would be amazing, feel free to do so!

jfversluis avatar Jul 05 '24 17:07 jfversluis

Sorry for that... I just wanted to rename branch. Didn't know it will work that way:/

ArturWyszomirski avatar Sep 09 '24 21:09 ArturWyszomirski

No worries! I was already sad you were closing it haha! @FreakyAli would you still have time to look at this? Else I might see if I can take some time to make an attempt

jfversluis avatar Sep 10 '24 06:09 jfversluis

Quite the opposite:) I have just fixed the conflict with the latest commit and working on making a sample of silence detection.

ArturWyszomirski avatar Sep 10 '24 07:09 ArturWyszomirski

I think this PR is superseded by https://github.com/jfversluis/Plugin.Maui.Audio/pull/130. I'm closing this for now but feel free to reopen if I've made a mistake

bijington avatar Feb 20 '25 06:02 bijington