linx-simulator2/node_modules/mumble-client-codecs-node/lib/index.js
2019-09-18 11:11:16 +03:00

43 lines
1.1 KiB
JavaScript

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.opus = exports.celt = undefined;
exports.getDuration = getDuration;
exports.createDecoderStream = createDecoderStream;
exports.createEncoderStream = createEncoderStream;
var _nodeOpus = require('node-opus');
var _decoderStream = require('./decoder-stream');
var _decoderStream2 = _interopRequireDefault(_decoderStream);
var _opusEncoderStream = require('./opus-encoder-stream');
var _opusEncoderStream2 = _interopRequireDefault(_opusEncoderStream);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var celt = exports.celt = [];
var opus = exports.opus = true;
function getDuration(codec, buffer) {
if (codec === 'Opus') {
// node-opus doesn't expose the relevant libopus function
return 10;
} else {
return 1;
}
}
function createDecoderStream(user) {
return new _decoderStream2.default();
}
function createEncoderStream(codec) {
if (codec === 'Opus') {
return new _opusEncoderStream2.default(codec);
}
}