@tencentcloud/trtc-cloud-wx 0.0.22 → 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 +13 -7
package/package.json
CHANGED
package/trtc-cloud-wx.js
CHANGED
|
@@ -1393,7 +1393,7 @@ var Logger = /*#__PURE__*/function () {
|
|
|
1393
1393
|
var logger = new Logger();
|
|
1394
1394
|
|
|
1395
1395
|
var name = "@tencentcloud/trtc-cloud-wx";
|
|
1396
|
-
var version = "0.0.
|
|
1396
|
+
var version = "0.0.23";
|
|
1397
1397
|
var description = "";
|
|
1398
1398
|
var main = "dist/trtc-cloud-wx.js";
|
|
1399
1399
|
var module$1 = "dist/trtc-cloud-wx.js";
|
|
@@ -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,16 +2387,22 @@ 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
|
-
this.emit('onUserAudioAvailable', this.userId, 1);
|
|
2399
2406
|
if (this.enterRoom) {
|
|
2400
2407
|
this.emit('onSendFirstLocalAudioFrame');
|
|
2401
2408
|
}
|
|
@@ -2422,8 +2429,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2422
2429
|
}, 'stopLocalAudio');
|
|
2423
2430
|
case 3:
|
|
2424
2431
|
logger.info('stopLocalAudio success');
|
|
2425
|
-
|
|
2426
|
-
case 5:
|
|
2432
|
+
case 4:
|
|
2427
2433
|
case "end":
|
|
2428
2434
|
return _context19.stop();
|
|
2429
2435
|
}
|