Files
JiboSDK/node_modules/jibo/lib/asr/speaker-action.js
2026-03-22 03:21:45 +02:00

1 line
1.7 KiB
JavaScript

"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},t=function(){function e(e,t){for(var r in t){var n=t[r];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),r=function c(e,t,r){var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var i=Object.getPrototypeOf(e);return null===i?void 0:c(i,t,r)}if("value"in n&&n.writable)return n.value;var o=n.get;if(void 0!==o)return o.call(r)},n=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=e(require("uuid")),u=e(require("./asr-vars")),a=require("events").EventEmitter,s=function(e){function a(e){i(this,a),r(Object.getPrototypeOf(a.prototype),"constructor",this).call(this),this.httpInterface=e,this.id="spkr-action-"+o.v4(),u.idToAction[this.id]=this}return n(a,e),t(a,{setAudioSourceId:{value:function(e){this.audioSourceId=e}},deleteSpeaker:{value:function(){var e=void 0===arguments[0]?"":arguments[0],t=void 0===arguments[1]?"Text-Dependent":arguments[1],r=new XMLHttpRequest,n={action:"delete",task_id:this.id,spkr_id_type:t,speaker_name:e};n=JSON.stringify(n),r.open("POST",this.httpInterface,!0),r.send(n)}},listSpeakers:{value:function(){var e=void 0===arguments[0]?"":arguments[0],t=void 0===arguments[1]?"Text-Dependent":arguments[1],r=new XMLHttpRequest,n={action:"list",task_id:this.id,spkr_id_type:t,speaker_name:e};n=JSON.stringify(n),r.open("POST",this.httpInterface,!0),r.send(n)}}}),a}(a);module.exports=s;