@tencentcloud/trtc-cloud-wx 0.0.23 → 0.0.24-beta.0
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 +12 -4
package/package.json
CHANGED
package/trtc-cloud-wx.js
CHANGED
|
@@ -2376,6 +2376,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2376
2376
|
key: "startLocalAudio",
|
|
2377
2377
|
value: function startLocalAudio(quality) {
|
|
2378
2378
|
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
2379
|
+
var getAudioQuality;
|
|
2379
2380
|
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
2380
2381
|
while (1) switch (_context18.prev = _context18.next) {
|
|
2381
2382
|
case 0:
|
|
@@ -2386,19 +2387,26 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2386
2387
|
}
|
|
2387
2388
|
throw new Error('Current role is audience, unable to access mic. Call switchRole to become a host.');
|
|
2388
2389
|
case 3:
|
|
2389
|
-
|
|
2390
|
+
getAudioQuality = function getAudioQuality(quality) {
|
|
2391
|
+
if (quality === exports.TRTCAudioQuality.TRTCAudioQualityDefault || quality === exports.TRTCAudioQuality.TRTCAudioQualitySpeech) {
|
|
2392
|
+
return 'low';
|
|
2393
|
+
}
|
|
2394
|
+
return 'high';
|
|
2395
|
+
};
|
|
2396
|
+
_context18.next = 6;
|
|
2390
2397
|
return this.setAttributes({
|
|
2391
2398
|
params: {
|
|
2392
|
-
enableMic: true
|
|
2399
|
+
enableMic: true,
|
|
2400
|
+
audioQuality: getAudioQuality(quality)
|
|
2393
2401
|
}
|
|
2394
2402
|
}, 'startLocalAudio');
|
|
2395
|
-
case
|
|
2403
|
+
case 6:
|
|
2396
2404
|
logger.info('startLocalAudio success');
|
|
2397
2405
|
this.emit('onMicDidReady');
|
|
2398
2406
|
if (this.enterRoom) {
|
|
2399
2407
|
this.emit('onSendFirstLocalAudioFrame');
|
|
2400
2408
|
}
|
|
2401
|
-
case
|
|
2409
|
+
case 9:
|
|
2402
2410
|
case "end":
|
|
2403
2411
|
return _context18.stop();
|
|
2404
2412
|
}
|