UNPKG

@skyway-sdk/core

Version:

The official Next Generation JavaScript SDK for SkyWay

23 lines 955 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RemoteAudioStream = void 0; const audioLevel_1 = require("../audioLevel"); const media_1 = require("./media"); class RemoteAudioStream extends media_1.RemoteMediaStreamBase { /**@internal */ constructor(id, track) { super(id, 'audio', track); this.track = track; this.contentType = 'audio'; } /**@description [japanese] 直近100msにおける最大音量を取得する(値の範囲:0-1) */ getAudioLevel() { // 不要なリソース生成を行わないように初回実行時にAudioLevelインスタンスを生成する if (this._audioLevel === undefined) { this._audioLevel = new audioLevel_1.AudioLevel(this.track); } return this.track.enabled ? this._audioLevel.calculate() : 0; } } exports.RemoteAudioStream = RemoteAudioStream; //# sourceMappingURL=audio.js.map