@tencentcloud/trtc-cloud-wx 0.0.23 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/trtc-cloud-wx.js +17 -6
package/package.json
CHANGED
package/trtc-cloud-wx.js
CHANGED
|
@@ -610,8 +610,11 @@ exports.TRTCVideoMirrorType = void 0;
|
|
|
610
610
|
})(exports.TRTCVideoMirrorType || (exports.TRTCVideoMirrorType = {}));
|
|
611
611
|
exports.TRTCAudioQuality = void 0;
|
|
612
612
|
(function (TRTCAudioQuality) {
|
|
613
|
-
|
|
613
|
+
/** 语音模式:采样率:16k;单声道;音频裸码率:16kbps;适合语音通话为主的场景,比如在线会议,语音通话。 */
|
|
614
614
|
TRTCAudioQuality[TRTCAudioQuality["TRTCAudioQualitySpeech"] = 1] = "TRTCAudioQualitySpeech";
|
|
615
|
+
/** 标准模式(或者默认模式):采样率:48k;单声道;音频裸码率:50kbps;SDK 默认的音频质量,如无特殊需求推荐选择之。 */
|
|
616
|
+
TRTCAudioQuality[TRTCAudioQuality["TRTCAudioQualityDefault"] = 2] = "TRTCAudioQualityDefault";
|
|
617
|
+
/** 音乐模式:采样率:48k;双声道 + 全频带;音频裸码率:128kbps;适合需要高保真传输音乐的场景,比如K歌、音乐直播等。 */
|
|
615
618
|
TRTCAudioQuality[TRTCAudioQuality["TRTCAudioQualityMusic"] = 3] = "TRTCAudioQualityMusic";
|
|
616
619
|
})(exports.TRTCAudioQuality || (exports.TRTCAudioQuality = {}));
|
|
617
620
|
exports.TRTCBeautyStyle = void 0;
|
|
@@ -1393,7 +1396,7 @@ var Logger = /*#__PURE__*/function () {
|
|
|
1393
1396
|
var logger = new Logger();
|
|
1394
1397
|
|
|
1395
1398
|
var name = "@tencentcloud/trtc-cloud-wx";
|
|
1396
|
-
var version = "0.0.
|
|
1399
|
+
var version = "0.0.24";
|
|
1397
1400
|
var description = "";
|
|
1398
1401
|
var main = "dist/trtc-cloud-wx.js";
|
|
1399
1402
|
var module$1 = "dist/trtc-cloud-wx.js";
|
|
@@ -2376,6 +2379,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2376
2379
|
key: "startLocalAudio",
|
|
2377
2380
|
value: function startLocalAudio(quality) {
|
|
2378
2381
|
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
2382
|
+
var getAudioQuality;
|
|
2379
2383
|
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
2380
2384
|
while (1) switch (_context18.prev = _context18.next) {
|
|
2381
2385
|
case 0:
|
|
@@ -2386,19 +2390,26 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2386
2390
|
}
|
|
2387
2391
|
throw new Error('Current role is audience, unable to access mic. Call switchRole to become a host.');
|
|
2388
2392
|
case 3:
|
|
2389
|
-
|
|
2393
|
+
getAudioQuality = function getAudioQuality(quality) {
|
|
2394
|
+
if (quality === exports.TRTCAudioQuality.TRTCAudioQualitySpeech) {
|
|
2395
|
+
return 'low';
|
|
2396
|
+
}
|
|
2397
|
+
return 'high';
|
|
2398
|
+
};
|
|
2399
|
+
_context18.next = 6;
|
|
2390
2400
|
return this.setAttributes({
|
|
2391
2401
|
params: {
|
|
2392
|
-
enableMic: true
|
|
2402
|
+
enableMic: true,
|
|
2403
|
+
audioQuality: getAudioQuality(quality)
|
|
2393
2404
|
}
|
|
2394
2405
|
}, 'startLocalAudio');
|
|
2395
|
-
case
|
|
2406
|
+
case 6:
|
|
2396
2407
|
logger.info('startLocalAudio success');
|
|
2397
2408
|
this.emit('onMicDidReady');
|
|
2398
2409
|
if (this.enterRoom) {
|
|
2399
2410
|
this.emit('onSendFirstLocalAudioFrame');
|
|
2400
2411
|
}
|
|
2401
|
-
case
|
|
2412
|
+
case 9:
|
|
2402
2413
|
case "end":
|
|
2403
2414
|
return _context18.stop();
|
|
2404
2415
|
}
|