Skip to content

Commit

Permalink
mod_vad_detect
Browse files Browse the repository at this point in the history
  • Loading branch information
xquanluu committed May 27, 2024
1 parent 60670f6 commit 862d3f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ class Endpoint extends Emitter {
}
/**
* VAD detection
* @param {string} opts.action = one-shot, continuou, default is one-shot
* @param {string} opts.strategy = one-shot, continuous, default is one-shot
* @param {string} [opts.mode] Default value is 2
* -1 ("disable fvad, use native")
* - 0 ("quality")
Expand All @@ -929,14 +929,14 @@ class Endpoint extends Emitter {
*/
startVadDetection(opts, callback) {
opts = opts || {};
const action = opts.action | 'one-shot';
const strategy = opts.strategy | 'one-shot';
const mode = opts.mode | 2;
const silence_ms = opts.silence_ms | 250;
const voice_ms = opts.voice_ms | 150;
const bugname = opts.bugname | 'vad_detection';

const __x = (callback) => {
const args = [this.uuid, 'start', action, mode, silence_ms, voice_ms, bugname];
const args = [this.uuid, 'start', strategy, mode, silence_ms, voice_ms, bugname];
this.api('uuid_vad_detect', args, (err, evt) => {
if (err) return callback(err);
const body = evt.getBody() ;
Expand Down

0 comments on commit 862d3f8

Please sign in to comment.