Hi there! I am still evaluating OpenVidu. I have successfully implemented Push-To-Talk using the this.publisher.publishAudio(state);
API.
Now I would like to have some kind of an API which would let me do:
if (publisher is speaking) {
this.publisher.publishAudio(true);
} else {
this.publisher.publishAudio(false);
}
Perhaps with some granular control over the activation volume. I found a module called hark (https://www.npmjs.com/package/hark) which seemed promising but I can’t make it to work.
const monitor = hark(this.publisher.stream.getMediaStream());
monitor.on('speaking', () => {
console.log('Speaking');
});
monitor.on('stopped_speaking', () => {
console.log('stopped_speaking');
});