# Libraries for Voice Activity Detection (Not Speech Recognition)

As follow up to my previous question I was wondering if there are any speech detection libraries in existence. By speech detection I mean passing in an audio buffer and getting back an index of where speech starts and stops. So if I have 10 seconds of audio sampling at 44kHz, I would expect an array of numbers such as:

44000
88000
123000
190334
...


This would indicate for example that speech starts one second in and then finishes at the two second point, etc.

What I'm not looking for is speech recognition which writes out text from spoken word. This unfortunately is what I see a lot of when I google 'speech detection'.

It would be great if the library was in C, C++ or even Objective-C as I'm writing an app for the iPhone.

Thanks!

• You might find your answer in one of these answer: dsp.stackexchange.com/questions/912/… May 16 '12 at 9:39
• This is very similar, except singing instead of speech: dsp.stackexchange.com/q/2367/29 May 16 '12 at 14:01
• Also relevant: dsp.stackexchange.com/a/1543/29 "voice activity detection" May 16 '12 at 14:09
• You should look into onset/offset detection. Its an active field with many applications in music, speech and radar signal processing. May 16 '12 at 15:09

In my answer to your that question, I had mentioned that Voice Activity Detection is a standard feature for codecs like G.729 and such others.

You should look for reference encoders and decoders for algorithms that applies this.

One such example is - http://www.voiceage.com/openinit_g729.php

Another possible source is Speex codec. Which implements VAD

BTW: You should google "Voice Activity Detection" or "Talk Spurt" rather than "Speech Detection".

There are open source implementations in the Sphinx and Freeswitch projects. I think they are all energy based detectors do won't need any kind model.

Sphinx 4 (Java but it should be easy to port to C/C++)

PocketSphinx

Freeswitch

Voice Activity Detection using Adaptive Threshold is very easy and handy to implement on any platform

Here you can have a algorithm which is Adaptive Energy based

Small addition to above algorithm when you are calculating for very first time go for taking Mean of Energy and mark as Emin

in this the frame you pass is divided in to sub-frames and further you can examine each sub-frame for its activity

you can overcome further problems with overlapped frames

• I'm trying to implement the method in the paper but get lost when the Min_E is zero due to noise suppression. In that case, the Thresh_E would be -INF from the equation. Even taking log1p(Min_E), the Thresh_E would be zero such that it is very easy to misclassify voiced frames because of non-zero energy. Any good suggestions or am I misunderstand it? Equations: Thresh _ E Energy _ Pr imThresh*log(Min _ E) Nov 29 '15 at 0:29

Seems like that does exactly what you're describing.

Disclosure: I'm the developer behind LibVAD

• How does one get libVAD?
– todd
Mar 31 '16 at 14:18
• By purchasing it. The website doesn't disclose a price until after you fill in a form, though. Oct 7 '16 at 21:33
• Link now goes to a malware site wanting visitors to update flash. Sep 11 '18 at 20:09