trtc-sdk-v5 5.11.0-wasm.1 → 5.11.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/index.d.ts +34 -13
- package/package.json +6 -4
- package/plugins/cdn-streaming/package.json +1 -1
- package/plugins/cross-room/package.json +1 -1
- package/plugins/custom-encryption/package.json +1 -1
- package/plugins/device-detector/package.json +1 -1
- package/plugins/small-stream-auto-switcher/package.json +1 -1
- package/plugins/small-stream-auto-switcher/small-stream-auto-switcher.esm.js +1 -1
- package/plugins/small-stream-auto-switcher/small-stream-auto-switcher.umd.js +1 -1
- package/plugins/video-decoder/package.json +1 -1
- package/plugins/video-effect/basic-beauty/package.json +1 -1
- package/plugins/video-effect/beauty/package.json +1 -1
- package/plugins/video-effect/video-mixer/package.json +1 -1
- package/plugins/video-effect/virtual-background/package.json +1 -1
- package/plugins/video-effect/watermark/package.json +1 -1
- package/plugins/voice-changer/package.json +1 -1
- package/trtc.esm.js +43 -64
- package/trtc.js +1 -1
- package/assets/av_processing.wasm +0 -0
- package/assets/worker.js +0 -17
package/index.d.ts
CHANGED
|
@@ -12,8 +12,8 @@ import { InitAudioProcessorOptions, UpdateAudioProcessorOptions } from 'trtc-js-
|
|
|
12
12
|
|
|
13
13
|
export { CDNStreamingOptions, DeviceDetectorOptions, VirtualBackgroundOptions, UpdateVirtualBackgroundOptions, WatermarkOptions, BeautyOptions, UpdateBeautyOptions, BasicBeautyOptions, StartCrossRoomOption, UpdateCrossRoomOption, StopCrossRoomOption, SmallStreamAutoSwitcherOptions, VideoMixerOptions };
|
|
14
14
|
type TRTCPlugin = typeof CrossRoom | typeof CDNStreaming | typeof DeviceDetector | typeof VirtualBackground | typeof Watermark | typeof Beauty | typeof BasicBeauty | typeof CustomEncryption | typeof SmallStreamAutoSwitcher | typeof VideoMixer;
|
|
15
|
-
export declare
|
|
16
|
-
|
|
15
|
+
export declare type ExperimentalAPIFunctionMap = {
|
|
16
|
+
'enableAudioFrameEvent': EnableAudioFrameEventOptions;
|
|
17
17
|
}
|
|
18
18
|
export declare type PluginStartOptionsMap = {
|
|
19
19
|
'AudioMixer': AudioMixerOptions;
|
|
@@ -688,6 +688,13 @@ export declare interface VideoFrameConfig {
|
|
|
688
688
|
export declare const enum AutoStartPluginName {
|
|
689
689
|
Debug = 'Debug'
|
|
690
690
|
}
|
|
691
|
+
export declare interface EnableAudioFrameEventOptions {
|
|
692
|
+
enable: boolean
|
|
693
|
+
userId: string
|
|
694
|
+
sampleRate?: number
|
|
695
|
+
channelCount?: number
|
|
696
|
+
port?: MessagePort
|
|
697
|
+
}
|
|
691
698
|
|
|
692
699
|
/**
|
|
693
700
|
* @typedef TRTCStatistics TRTC statistics
|
|
@@ -726,6 +733,14 @@ export declare const enum AutoStartPluginName {
|
|
|
726
733
|
* @property {number} frameRate Video frameRate
|
|
727
734
|
* @property {'big'|'small'|'sub'} videoType Video type: big, small, sub.
|
|
728
735
|
*/
|
|
736
|
+
/** enableAudioFrameEvent Options
|
|
737
|
+
* @typedef EnableAudioFrameEventOptions
|
|
738
|
+
* @property {boolean} enable Whether to enable callback of audio frame
|
|
739
|
+
* @property {string} userId The userId of the monitored user. '' indicates local microphone data, '*' indicates monitoring the audio data of all remote users.
|
|
740
|
+
* @property {number=} [sampleRate=48000] Set the sampling rate of pcm data, the default is 48000. Support 8000, 16000, 32000, 44100, 48000
|
|
741
|
+
* @property {number=} [channelCount=1] Set the number of channels of pcm data, the default is 1. Support 1, 2
|
|
742
|
+
* @property {MessagePort=} port Set the MessagePort for the pcm callback
|
|
743
|
+
*/
|
|
729
744
|
/**
|
|
730
745
|
* **TRTC Event List**<br>
|
|
731
746
|
* <br>
|
|
@@ -1860,7 +1875,7 @@ export declare class TRTC {
|
|
|
1860
1875
|
/**
|
|
1861
1876
|
* Used to control the playback volume of remote audio.<br>
|
|
1862
1877
|
*
|
|
1863
|
-
* -
|
|
1878
|
+
* - Not supported by iOS Safari
|
|
1864
1879
|
* @param {string} userId - Remote user ID。'*' represents all remote users.
|
|
1865
1880
|
* @param {number} volume - Volume, ranging from 0 to 100. The default value is 100.<br>
|
|
1866
1881
|
* Since `v5.1.3+`, the volume can be set higher than 100.
|
|
@@ -2095,18 +2110,24 @@ export declare class TRTC {
|
|
|
2095
2110
|
/**
|
|
2096
2111
|
* call experimental API
|
|
2097
2112
|
*
|
|
2098
|
-
* |
|
|
2099
|
-
* |
|
|
2100
|
-
* | enableAudioFrameEvent |
|
|
2113
|
+
* | APIName | name | param |
|
|
2114
|
+
* | --- | --- | --- |
|
|
2115
|
+
* | 'enableAudioFrameEvent' | Config the pcm data of Audio Frame Event | [EnableAudioFrameEventOptions](https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/en/global.html#EnableAudioFrameEventOptions) |
|
|
2101
2116
|
* @private
|
|
2102
2117
|
* @param {string} name
|
|
2103
|
-
* @param {
|
|
2104
|
-
* @example
|
|
2105
|
-
*
|
|
2106
|
-
* await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: true, userId: '
|
|
2107
|
-
*
|
|
2108
|
-
|
|
2109
|
-
|
|
2118
|
+
* @param {EnableAudioFrameEventOptions} options
|
|
2119
|
+
* @example
|
|
2120
|
+
* // Call back the pcm data of the remote user 'user_A'. The default pcm data is 48kHZ, mono
|
|
2121
|
+
* await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: true, userId: 'user_A'})
|
|
2122
|
+
* // Call back all remote pcm data and set the pcm data to 16kHZ, stereo
|
|
2123
|
+
* await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: true, userId: '*', sampleRate: 16000, channelCount: 2 })
|
|
2124
|
+
* // Set the MessagePort for the local microphone pcm data callback
|
|
2125
|
+
* await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: true, userId: '', port })
|
|
2126
|
+
* // Cancel callback of local microphone pcm data
|
|
2127
|
+
* await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: false, userId: '' })
|
|
2128
|
+
*/
|
|
2129
|
+
callExperimentalAPI<T extends keyof ExperimentalAPIFunctionMap, O extends ExperimentalAPIFunctionMap[T]>(name: O extends undefined ? never : T, options: O): Promise<void>;
|
|
2130
|
+
callExperimentalAPI<T extends keyof ExperimentalAPIFunctionMap, O extends ExperimentalAPIFunctionMap[T]>(name: O extends undefined ? T : never): Promise<void>;
|
|
2110
2131
|
static EVENT: typeof TRTCEvent;
|
|
2111
2132
|
static ERROR_CODE: {
|
|
2112
2133
|
INVALID_PARAMETER: number;
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trtc-sdk-v5",
|
|
3
|
-
"version": "5.11.0
|
|
3
|
+
"version": "5.11.0",
|
|
4
4
|
"description": "Tencent Cloud RTC SDK for Web",
|
|
5
|
-
"
|
|
6
|
-
"type": "module",
|
|
5
|
+
"main": "trtc.js",
|
|
7
6
|
"types": "index.d.ts",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"webrtc-adapter": "^8.2.3"
|
|
9
|
+
},
|
|
8
10
|
"keywords": [
|
|
9
11
|
"webrtc",
|
|
10
12
|
"TRTC",
|
|
@@ -27,4 +29,4 @@
|
|
|
27
29
|
},
|
|
28
30
|
"author": "Tencent Cloud Client R&D Center",
|
|
29
31
|
"license": "ISC"
|
|
30
|
-
}
|
|
32
|
+
}
|