Re: [pjsip] VAD in pjmedia

GK
Gabor K
Sun, Jun 18, 2017 4:34 PM

Hi,

some background information:
my task is to control a voice recorder:
incoming rtp stream has to be stored in wav file only in case of voice
activity can be observed on the incoming stream.

Regarding to VAD I have found the following pjsip Forum entry from 2008:

Tue Apr 8 06:38:38 EDT 2008

Hi Markus,

Assuming you are talking about microphone silence detection,
currently there is no callback/trigger mechanism for silence detection.

However, you have some alternatives to do this:

1. Monitor the rx_level of sound port (normally slot 0) in the
conference periodically.
See pjmedia_conf_get_signal_level() API.

2. Implement a pjmedia port that utilize existing silence detector to
do callback when such conditions are reached (e.g: start silence, start
talking).

Then, this port can be stacked to any port you would like to monitor
(in this case, sound port). The port connection will be about:
conference bridge <--> silencedet port <--> sound port.

We will be glad if somebody would implement the second alternative and
share the implementation to us.

Regards,
Nanang

Nanang,
regarding to "Alternative 2": have been already implemented any
enhancements since 2008?
If yes: can you give me some links where to find them and some examples how
to integrate it?
If no: can you give me some more details on pjmedia port implementation to
utilize the existing silence detecto
r?

Thank you in advance:
Gabor

On Fri, Jun 16, 2017 at 12:06 PM, Gabor K gabor58k@gmail.com wrote:

Hi,
I am wondering how to use/integrate Voice Activity Detector of pj's
codecs, e.g.: G.711.
I have found the pjmedia_silence_det_detect() API but I can not find any
example code which shows how to use it.
Can you give me some pointers or some short advises?
Thank you.
Gabor

Hi, some background information: my task is to control a voice recorder: incoming rtp stream has to be stored in wav file only in case of voice activity can be observed on the incoming stream. Regarding to VAD I have found the following pjsip Forum entry from 2008: *Tue Apr 8 06:38:38 EDT 2008* > > *Hi Markus,* > > *Assuming you are talking about microphone silence detection,* > *currently there is no callback/trigger mechanism for silence detection.* > > *However, you have some alternatives to do this:* > > *1. Monitor the rx_level of sound port (normally slot 0) in the* > *conference periodically.* > *See pjmedia_conf_get_signal_level() API.* > > *2. Implement a pjmedia port that utilize existing silence detector to* > *do callback when such conditions are reached (e.g: start silence, start > talking).* > *Then, this port can be stacked to any port you would like to monitor* > *(in this case, sound port). The port connection will be about:* > *conference bridge <--> silencedet port <--> sound port.* > > *We will be glad if somebody would implement the second alternative and* > *share the implementation to us.* > > *Regards,* > *Nanang* > Nanang, regarding to "Alternative 2": have been already implemented any enhancements since 2008? If yes: can you give me some links where to find them and some examples how to integrate it? If no: can you give me some more details on *pjmedia port implementation to utilize the existing silence detecto*r? Thank you in advance: Gabor On Fri, Jun 16, 2017 at 12:06 PM, Gabor K <gabor58k@gmail.com> wrote: > Hi, > I am wondering how to use/integrate Voice Activity Detector of pj's > codecs, e.g.: G.711. > I have found the pjmedia_silence_det_detect() API but I can not find any > example code which shows how to use it. > Can you give me some pointers or some short advises? > Thank you. > Gabor > >
KS
Kevin Stewart
Mon, Jan 25, 2021 11:21 PM

Gabor,

Did you get your VAD issue resolved? I have the same issue and cannot
find any example code nor doc on how to "stack" audio ports.

Any help would be greatly appreciated.

Thanks,

Kevin

Gabor, Did you get your VAD issue resolved? I have the same issue and cannot find any example code nor doc on how to "stack" audio ports. Any help would be greatly appreciated. Thanks, Kevin