Skip to main content
Topic: Using Opus 1.3.1 for VAD (Read 1026 times) previous topic - next topic
0 Members and 4 Guests are viewing this topic.

Using Opus 1.3.1 for VAD

Heya,

I need to perform VAD for this service I am working on and my plan is to use Opus 1.3.1 to provide it. As far as a I can tell, the only way to do that is to opus_encode the audio and then check if the number of output bytes is less than 2.

Code: [Select]
unsigned char output_frame[4000];
int bytes;
if ((bytes = opus_encode(encoder_.get(), frame, 80, output_frame, 4000)) < 2) {
    return false;
}
return true;

The audio here is 8khz mono channel audio with 16 bit depth.

My trouble is when I run this function on all 0s, it still encodes to 5 bytes. If I run

Code: [Select]
opus_encoder_ctl(encoder_.get(), OPUS_GET_IN_DTX(&result));

The result is false even though the input is all 0s.

1). What am I doing wrong here? Shouldn't all 0s trigger DTX?
2). Is there a simpler way I can just invoke the VAD without also having to encode the audio and then throw the result away?

Thanks,
Prashant


 

Re: Using Opus 1.3.1 for VAD

Reply #1
Have you set DTX on?

 
SimplePortal 1.0.0 RC1 © 2008-2019