trtc-sdk-v5 5.11.2-beta.3 → 5.11.2-beta.4
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 +35 -13
- package/package.json +1 -1
- 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/device-detector.esm.d.ts +2 -1
- package/plugins/device-detector/device-detector.esm.js +7 -7
- package/plugins/device-detector/device-detector.umd.js +2 -2
- package/plugins/device-detector/package.json +1 -1
- package/plugins/small-stream-auto-switcher/package.json +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/virtual-background/virtual-background.esm.js +1 -1
- package/plugins/video-effect/virtual-background/virtual-background.umd.js +1 -1
- package/plugins/video-effect/watermark/package.json +1 -1
- package/plugins/voice-changer/package.json +1 -1
- package/trtc.esm.js +32 -32
- package/trtc.js +1 -1
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;
|
|
@@ -692,6 +692,13 @@ export declare interface VideoFrameConfig {
|
|
|
692
692
|
export declare const enum AutoStartPluginName {
|
|
693
693
|
Debug = 'Debug'
|
|
694
694
|
}
|
|
695
|
+
export declare interface EnableAudioFrameEventOptions {
|
|
696
|
+
enable: boolean
|
|
697
|
+
userId: string
|
|
698
|
+
sampleRate?: number
|
|
699
|
+
channelCount?: number
|
|
700
|
+
port?: MessagePort
|
|
701
|
+
}
|
|
695
702
|
|
|
696
703
|
/**
|
|
697
704
|
* @typedef TRTCStatistics TRTC statistics
|
|
@@ -730,6 +737,14 @@ export declare const enum AutoStartPluginName {
|
|
|
730
737
|
* @property {number} frameRate Video frameRate
|
|
731
738
|
* @property {'big'|'small'|'sub'} videoType Video type: big, small, sub.
|
|
732
739
|
*/
|
|
740
|
+
/** enableAudioFrameEvent Options
|
|
741
|
+
* @typedef EnableAudioFrameEventOptions
|
|
742
|
+
* @property {boolean} enable Whether to enable callback of audio frame
|
|
743
|
+
* @property {string} userId The userId of the monitored user. '' indicates local microphone data, '*' indicates monitoring the audio data of all remote users.
|
|
744
|
+
* @property {number=} [sampleRate=48000] Set the sampling rate of pcm data, the default is 48000. Support 8000, 16000, 32000, 44100, 48000
|
|
745
|
+
* @property {number=} [channelCount=1] Set the number of channels of pcm data, the default is 1. Support 1, 2
|
|
746
|
+
* @property {MessagePort=} port Set the MessagePort for the pcm callback
|
|
747
|
+
*/
|
|
733
748
|
/**
|
|
734
749
|
* **TRTC Event List**<br>
|
|
735
750
|
* <br>
|
|
@@ -1191,6 +1206,7 @@ export declare interface TRTCEventTypes {
|
|
|
1191
1206
|
result: {
|
|
1192
1207
|
userId: string;
|
|
1193
1208
|
volume: number;
|
|
1209
|
+
floatVolume: number;
|
|
1194
1210
|
}[];
|
|
1195
1211
|
}];
|
|
1196
1212
|
[TRTCEvent.AUDIO_FRAME]: [{
|
|
@@ -1864,7 +1880,7 @@ export declare class TRTC {
|
|
|
1864
1880
|
/**
|
|
1865
1881
|
* Used to control the playback volume of remote audio.<br>
|
|
1866
1882
|
*
|
|
1867
|
-
* -
|
|
1883
|
+
* - Not supported by iOS Safari
|
|
1868
1884
|
* @param {string} userId - Remote user ID。'*' represents all remote users.
|
|
1869
1885
|
* @param {number} volume - Volume, ranging from 0 to 100. The default value is 100.<br>
|
|
1870
1886
|
* Since `v5.1.3+`, the volume can be set higher than 100.
|
|
@@ -2099,18 +2115,24 @@ export declare class TRTC {
|
|
|
2099
2115
|
/**
|
|
2100
2116
|
* call experimental API
|
|
2101
2117
|
*
|
|
2102
|
-
* |
|
|
2103
|
-
* |
|
|
2104
|
-
* | enableAudioFrameEvent |
|
|
2118
|
+
* | APIName | name | param |
|
|
2119
|
+
* | --- | --- | --- |
|
|
2120
|
+
* | 'enableAudioFrameEvent' | Config the pcm data of Audio Frame Event | [EnableAudioFrameEventOptions](https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/en/global.html#EnableAudioFrameEventOptions) |
|
|
2105
2121
|
* @private
|
|
2106
2122
|
* @param {string} name
|
|
2107
|
-
* @param {
|
|
2108
|
-
* @example
|
|
2109
|
-
*
|
|
2110
|
-
* await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: true, userId: '
|
|
2111
|
-
*
|
|
2112
|
-
|
|
2113
|
-
|
|
2123
|
+
* @param {EnableAudioFrameEventOptions} options
|
|
2124
|
+
* @example
|
|
2125
|
+
* // Call back the pcm data of the remote user 'user_A'. The default pcm data is 48kHZ, mono
|
|
2126
|
+
* await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: true, userId: 'user_A'})
|
|
2127
|
+
* // Call back all remote pcm data and set the pcm data to 16kHZ, stereo
|
|
2128
|
+
* await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: true, userId: '*', sampleRate: 16000, channelCount: 2 })
|
|
2129
|
+
* // Set the MessagePort for the local microphone pcm data callback
|
|
2130
|
+
* await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: true, userId: '', port })
|
|
2131
|
+
* // Cancel callback of local microphone pcm data
|
|
2132
|
+
* await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: false, userId: '' })
|
|
2133
|
+
*/
|
|
2134
|
+
callExperimentalAPI<T extends keyof ExperimentalAPIFunctionMap, O extends ExperimentalAPIFunctionMap[T]>(name: O extends undefined ? never : T, options: O): Promise<void>;
|
|
2135
|
+
callExperimentalAPI<T extends keyof ExperimentalAPIFunctionMap, O extends ExperimentalAPIFunctionMap[T]>(name: O extends undefined ? T : never): Promise<void>;
|
|
2114
2136
|
static EVENT: typeof TRTCEvent;
|
|
2115
2137
|
static ERROR_CODE: {
|
|
2116
2138
|
INVALID_PARAMETER: number;
|
package/package.json
CHANGED