agora-electron-sdk 4.2.6 → 4.3.0-dev.1

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.
Files changed (172) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/js/Private/AgoraBase.js +139 -174
  3. package/js/Private/AgoraMediaBase.js +49 -20
  4. package/js/Private/AgoraMediaPlayerTypes.js +32 -23
  5. package/js/Private/IAgoraH265Transcoder.js +39 -0
  6. package/js/Private/IAgoraMediaStreamingSource.js +32 -32
  7. package/js/Private/IAgoraMusicContentCenter.js +19 -19
  8. package/js/Private/IAgoraRhythmPlayer.js +9 -9
  9. package/js/Private/IAgoraRtcEngine.js +12 -12
  10. package/js/Private/IAgoraSpatialAudio.js +3 -31
  11. package/js/Private/extension/IAgoraH265TranscoderExtension.js +2 -0
  12. package/js/Private/impl/AgoraMediaBaseImpl.js +26 -2
  13. package/js/Private/impl/IAgoraH265TranscoderImpl.js +119 -0
  14. package/js/Private/impl/IAgoraMediaEngineImpl.js +13 -13
  15. package/js/Private/impl/IAgoraMediaPlayerImpl.js +92 -74
  16. package/js/Private/impl/IAgoraMediaPlayerSourceImpl.js +12 -2
  17. package/js/Private/impl/IAgoraMediaRecorderImpl.js +2 -2
  18. package/js/Private/impl/IAgoraMusicContentCenterImpl.js +20 -20
  19. package/js/Private/impl/IAgoraRtcEngineExImpl.js +66 -84
  20. package/js/Private/impl/IAgoraRtcEngineImpl.js +456 -440
  21. package/js/Private/impl/IAgoraSpatialAudioImpl.js +157 -181
  22. package/js/Private/impl/IAudioDeviceManagerImpl.js +22 -22
  23. package/js/Private/internal/AgoraH265TranscoderInternal.js +86 -0
  24. package/js/Private/internal/AgoraMediaBaseInternal.js +34 -0
  25. package/js/Private/internal/IrisApiEngine.js +35 -20
  26. package/js/Private/internal/LocalSpatialAudioEngineInternal.js +0 -39
  27. package/js/Private/internal/MediaPlayerInternal.js +22 -21
  28. package/js/Private/internal/MusicContentCenterInternal.js +1 -4
  29. package/js/Private/internal/RtcEngineExInternal.js +101 -134
  30. package/js/Private/ti/AgoraMediaBase-ti.js +1 -1
  31. package/js/Private/ti/IAgoraH265Transcoder-ti.js +40 -0
  32. package/js/Private/ti/IAgoraMediaPlayerSource-ti.js +4 -2
  33. package/js/Private/ti/IAgoraMusicContentCenter-ti.js +5 -5
  34. package/js/Private/ti/IAgoraRtcEngine-ti.js +12 -11
  35. package/js/Renderer/AgoraView.js +28 -14
  36. package/js/Renderer/IRenderer.js +65 -17
  37. package/js/Renderer/IRendererManager.js +230 -0
  38. package/js/Renderer/RendererCache.js +170 -0
  39. package/js/Renderer/RendererManager.js +49 -460
  40. package/js/Renderer/WebGLRenderer/index.js +82 -234
  41. package/js/Renderer/YUVCanvasRenderer/index.js +27 -147
  42. package/js/Types.js +6 -6
  43. package/js/Utils.js +37 -88
  44. package/package.json +4 -3
  45. package/scripts/clean.js +12 -0
  46. package/scripts/synclib.js +8 -2
  47. package/ts/Private/AgoraBase.ts +225 -201
  48. package/ts/Private/AgoraMediaBase.ts +63 -25
  49. package/ts/Private/AgoraMediaPlayerTypes.ts +67 -24
  50. package/ts/Private/IAgoraH265Transcoder.ts +73 -0
  51. package/ts/Private/IAgoraLog.ts +1 -0
  52. package/ts/Private/IAgoraMediaEngine.ts +12 -7
  53. package/ts/Private/IAgoraMediaPlayer.ts +47 -21
  54. package/ts/Private/IAgoraMediaPlayerSource.ts +27 -6
  55. package/ts/Private/IAgoraMediaStreamingSource.ts +38 -37
  56. package/ts/Private/IAgoraMusicContentCenter.ts +20 -20
  57. package/ts/Private/IAgoraRhythmPlayer.ts +7 -6
  58. package/ts/Private/IAgoraRtcEngine.ts +407 -364
  59. package/ts/Private/IAgoraRtcEngineEx.ts +25 -61
  60. package/ts/Private/IAgoraSpatialAudio.ts +80 -191
  61. package/ts/Private/IAudioDeviceManager.ts +27 -14
  62. package/ts/Private/extension/IAgoraH265TranscoderExtension.ts +39 -0
  63. package/ts/Private/impl/AgoraMediaBaseImpl.ts +25 -1
  64. package/ts/Private/impl/IAgoraH265TranscoderImpl.ts +152 -0
  65. package/ts/Private/impl/IAgoraMediaEngineImpl.ts +13 -13
  66. package/ts/Private/impl/IAgoraMediaPlayerImpl.ts +110 -81
  67. package/ts/Private/impl/IAgoraMediaPlayerSourceImpl.ts +17 -2
  68. package/ts/Private/impl/IAgoraMediaRecorderImpl.ts +2 -2
  69. package/ts/Private/impl/IAgoraMusicContentCenterImpl.ts +21 -21
  70. package/ts/Private/impl/IAgoraRtcEngineExImpl.ts +71 -106
  71. package/ts/Private/impl/IAgoraRtcEngineImpl.ts +589 -572
  72. package/ts/Private/impl/IAgoraSpatialAudioImpl.ts +211 -218
  73. package/ts/Private/impl/IAudioDeviceManagerImpl.ts +22 -22
  74. package/ts/Private/internal/AgoraH265TranscoderInternal.ts +97 -0
  75. package/ts/Private/internal/AgoraMediaBaseInternal.ts +15 -0
  76. package/ts/Private/internal/IrisApiEngine.ts +42 -27
  77. package/ts/Private/internal/LocalSpatialAudioEngineInternal.ts +1 -86
  78. package/ts/Private/internal/MediaPlayerInternal.ts +20 -29
  79. package/ts/Private/internal/MusicContentCenterInternal.ts +1 -5
  80. package/ts/Private/internal/RtcEngineExInternal.ts +91 -204
  81. package/ts/Private/ti/AgoraMediaBase-ti.ts +1 -1
  82. package/ts/Private/ti/IAgoraH265Transcoder-ti.ts +16 -0
  83. package/ts/Private/ti/IAgoraMediaPlayerSource-ti.ts +4 -2
  84. package/ts/Private/ti/IAgoraMusicContentCenter-ti.ts +5 -5
  85. package/ts/Private/ti/IAgoraRtcEngine-ti.ts +12 -11
  86. package/ts/Renderer/AgoraView.ts +29 -19
  87. package/ts/Renderer/IRenderer.ts +71 -22
  88. package/ts/Renderer/IRendererManager.ts +273 -19
  89. package/ts/Renderer/RendererCache.ts +167 -0
  90. package/ts/Renderer/RendererManager.ts +62 -607
  91. package/ts/Renderer/WebGLRenderer/index.ts +117 -295
  92. package/ts/Renderer/YUVCanvasRenderer/index.ts +45 -198
  93. package/ts/Types.ts +17 -194
  94. package/ts/Utils.ts +36 -100
  95. package/types/Private/AgoraBase.d.ts +219 -200
  96. package/types/Private/AgoraBase.d.ts.map +1 -1
  97. package/types/Private/AgoraMediaBase.d.ts +63 -27
  98. package/types/Private/AgoraMediaBase.d.ts.map +1 -1
  99. package/types/Private/AgoraMediaPlayerTypes.d.ts +65 -24
  100. package/types/Private/AgoraMediaPlayerTypes.d.ts.map +1 -1
  101. package/types/Private/IAgoraH265Transcoder.d.ts +28 -0
  102. package/types/Private/IAgoraH265Transcoder.d.ts.map +1 -0
  103. package/types/Private/IAgoraLog.d.ts.map +1 -1
  104. package/types/Private/IAgoraMediaEngine.d.ts +11 -6
  105. package/types/Private/IAgoraMediaEngine.d.ts.map +1 -1
  106. package/types/Private/IAgoraMediaPlayer.d.ts +42 -20
  107. package/types/Private/IAgoraMediaPlayer.d.ts.map +1 -1
  108. package/types/Private/IAgoraMediaPlayerSource.d.ts +23 -6
  109. package/types/Private/IAgoraMediaPlayerSource.d.ts.map +1 -1
  110. package/types/Private/IAgoraMediaStreamingSource.d.ts.map +1 -1
  111. package/types/Private/IAgoraMusicContentCenter.d.ts +19 -19
  112. package/types/Private/IAgoraMusicContentCenter.d.ts.map +1 -1
  113. package/types/Private/IAgoraRhythmPlayer.d.ts +6 -6
  114. package/types/Private/IAgoraRhythmPlayer.d.ts.map +1 -1
  115. package/types/Private/IAgoraRtcEngine.d.ts +329 -293
  116. package/types/Private/IAgoraRtcEngine.d.ts.map +1 -1
  117. package/types/Private/IAgoraRtcEngineEx.d.ts +21 -53
  118. package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -1
  119. package/types/Private/IAgoraSpatialAudio.d.ts +56 -167
  120. package/types/Private/IAgoraSpatialAudio.d.ts.map +1 -1
  121. package/types/Private/IAudioDeviceManager.d.ts +27 -14
  122. package/types/Private/IAudioDeviceManager.d.ts.map +1 -1
  123. package/types/Private/extension/IAgoraH265TranscoderExtension.d.ts +24 -0
  124. package/types/Private/extension/IAgoraH265TranscoderExtension.d.ts.map +1 -0
  125. package/types/Private/impl/AgoraMediaBaseImpl.d.ts +5 -1
  126. package/types/Private/impl/AgoraMediaBaseImpl.d.ts.map +1 -1
  127. package/types/Private/impl/IAgoraH265TranscoderImpl.d.ts +15 -0
  128. package/types/Private/impl/IAgoraH265TranscoderImpl.d.ts.map +1 -0
  129. package/types/Private/impl/IAgoraMediaPlayerImpl.d.ts +6 -4
  130. package/types/Private/impl/IAgoraMediaPlayerImpl.d.ts.map +1 -1
  131. package/types/Private/impl/IAgoraMediaPlayerSourceImpl.d.ts.map +1 -1
  132. package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts +2 -4
  133. package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts.map +1 -1
  134. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +30 -25
  135. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -1
  136. package/types/Private/impl/IAgoraSpatialAudioImpl.d.ts +20 -22
  137. package/types/Private/impl/IAgoraSpatialAudioImpl.d.ts.map +1 -1
  138. package/types/Private/internal/AgoraH265TranscoderInternal.d.ts +14 -0
  139. package/types/Private/internal/AgoraH265TranscoderInternal.d.ts.map +1 -0
  140. package/types/Private/internal/AgoraMediaBaseInternal.d.ts +8 -0
  141. package/types/Private/internal/AgoraMediaBaseInternal.d.ts.map +1 -0
  142. package/types/Private/internal/IrisApiEngine.d.ts +5 -2
  143. package/types/Private/internal/IrisApiEngine.d.ts.map +1 -1
  144. package/types/Private/internal/LocalSpatialAudioEngineInternal.d.ts +0 -15
  145. package/types/Private/internal/LocalSpatialAudioEngineInternal.d.ts.map +1 -1
  146. package/types/Private/internal/MediaPlayerInternal.d.ts.map +1 -1
  147. package/types/Private/internal/MusicContentCenterInternal.d.ts +0 -1
  148. package/types/Private/internal/MusicContentCenterInternal.d.ts.map +1 -1
  149. package/types/Private/internal/RtcEngineExInternal.d.ts +7 -13
  150. package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -1
  151. package/types/Private/ti/IAgoraH265Transcoder-ti.d.ts +8 -0
  152. package/types/Private/ti/IAgoraH265Transcoder-ti.d.ts.map +1 -0
  153. package/types/Private/ti/IAgoraMediaPlayerSource-ti.d.ts.map +1 -1
  154. package/types/Private/ti/IAgoraRtcEngine-ti.d.ts.map +1 -1
  155. package/types/Renderer/AgoraView.d.ts +4 -4
  156. package/types/Renderer/AgoraView.d.ts.map +1 -1
  157. package/types/Renderer/IRenderer.d.ts +11 -9
  158. package/types/Renderer/IRenderer.d.ts.map +1 -1
  159. package/types/Renderer/IRendererManager.d.ts +50 -12
  160. package/types/Renderer/IRendererManager.d.ts.map +1 -1
  161. package/types/Renderer/RendererCache.d.ts +36 -0
  162. package/types/Renderer/RendererCache.d.ts.map +1 -0
  163. package/types/Renderer/RendererManager.d.ts +13 -139
  164. package/types/Renderer/RendererManager.d.ts.map +1 -1
  165. package/types/Renderer/WebGLRenderer/index.d.ts +3 -18
  166. package/types/Renderer/WebGLRenderer/index.d.ts.map +1 -1
  167. package/types/Renderer/YUVCanvasRenderer/index.d.ts +4 -10
  168. package/types/Renderer/YUVCanvasRenderer/index.d.ts.map +1 -1
  169. package/types/Types.d.ts +11 -187
  170. package/types/Types.d.ts.map +1 -1
  171. package/types/Utils.d.ts +3 -20
  172. package/types/Utils.d.ts.map +1 -1
@@ -50,7 +50,7 @@ export abstract class IRtcEngineEx extends IRtcEngine {
50
50
  * You can call this method multiple times to join more than one channel.
51
51
  * If you are already in a channel, you cannot rejoin it with the same user ID.
52
52
  * If you want to join the same channel from different devices, ensure that the user IDs are different for all devices.
53
- * Ensure that the app ID you use to generate the token is the same as the app ID used when creating the IRtcEngine instance.
53
+ * Ensure that the App ID you use to generate the token is the same as the App ID used when creating the IRtcEngine instance.
54
54
  *
55
55
  * @param token The token generated on your server for authentication. If you need to join different channels at the same time or switch between channels, Agora recommends using a wildcard token so that you don't need to apply for a new token every time joining a channel.
56
56
  * @param connection The connection information. See RtcConnection.
@@ -111,9 +111,9 @@ export abstract class IRtcEngineEx extends IRtcEngine {
111
111
  ): number;
112
112
 
113
113
  /**
114
- * Sets the encoder configuration for the local video.
114
+ * Sets the video encoder configuration.
115
115
  *
116
- * Each configuration profile corresponds to a set of video parameters, including the resolution, frame rate, and bitrate. The config specified in this method is the maximum value under ideal network conditions. If the video engine cannot render the video using the specified config due to unreliable network conditions, the parameters further down the list are considered until a successful configuration is found.
116
+ * Sets the encoder configuration for the local video. Each configuration profile corresponds to a set of video parameters, including the resolution, frame rate, and bitrate. The config specified in this method is the maximum value under ideal network conditions. If the video engine cannot render the video using the specified config due to unreliable network conditions, the parameters further down the list are considered until a successful configuration is found.
117
117
  *
118
118
  * @param config Video profile. See VideoEncoderConfiguration.
119
119
  * @param connection The connection information. See RtcConnection.
@@ -181,12 +181,12 @@ export abstract class IRtcEngineEx extends IRtcEngine {
181
181
  ): number;
182
182
 
183
183
  /**
184
- * Sets the stream type of the remote video.
184
+ * Sets the video stream type to subscribe to.
185
185
  *
186
- * Under limited network conditions, if the publisher has not disabled the dual-stream mode using enableDualStreamModeEx (false), the receiver can choose to receive either the high-quality video stream or the low-quality video stream. The high-quality video stream has a higher resolution and bitrate, and the low-quality video stream has a lower resolution and bitrate. By default, users receive the high-quality video stream. Call this method if you want to switch to the low-quality video stream. This method allows the app to adjust the corresponding video stream type based on the size of the video window to reduce the bandwidth and resources. The aspect ratio of the low-quality video stream is the same as the high-quality video stream. Once the resolution of the high-quality video stream is set, the system automatically sets the resolution, frame rate, and bitrate of the low-quality video stream. The SDK enables the low-quality video stream auto mode on the sender by default (not actively sending low-quality video streams). The host at the receiving end can call this method to initiate a low-quality video stream stream request on the receiving end, and the sender automatically switches to the low-quality video stream mode after receiving the request.
186
+ * The SDK defaults to enabling low-quality video stream adaptive mode (AutoSimulcastStream) on the sender side, which means the sender does not actively send low-quality video stream. The receiver can initiate a low-quality video stream request by calling this method, and the sender will automatically start sending low-quality video stream upon receiving the request. By default, users receive the high-quality video stream. Call this method if you want to switch to the low-quality video stream. The SDK will dynamically adjust the size of the corresponding video stream based on the size of the video window to save bandwidth and computing resources. The default aspect ratio of the low-quality video stream is the same as that of the high-quality video stream. According to the current aspect ratio of the high-quality video stream, the system will automatically allocate the resolution, frame rate, and bitrate of the low-quality video stream. Under limited network conditions, if the publisher does not disable the dual-stream mode using enableDualStreamModeEx (false), the receiver can choose to receive either the high-quality video stream, or the low-quality video stream. The high-quality video stream has a higher resolution and bitrate, while the low-quality video stream has a lower resolution and bitrate.
187
187
  *
188
188
  * @param uid The user ID.
189
- * @param streamType The video stream type: VideoStreamType.
189
+ * @param streamType The video stream type, see VideoStreamType.
190
190
  * @param connection The connection information. See RtcConnection.
191
191
  *
192
192
  * @returns
@@ -542,8 +542,7 @@ export abstract class IRtcEngineEx extends IRtcEngine {
542
542
  * After calling createDataStreamEx, you can call this method to send data stream messages to all users in the channel. The SDK has the following restrictions on this method:
543
543
  * Up to 60 packets can be sent per second in a channel with each packet having a maximum size of 1 KB.
544
544
  * Each client can send up to 30 KB of data per second.
545
- * Each user can have up to five data streams simultaneously. A successful method call triggers the onStreamMessage callback on the remote client, from which the remote user gets the stream message.
546
- * A failed method call triggers the onStreamMessageError callback on the remote client.
545
+ * Each user can have up to five data streams simultaneously. A successful method call triggers the onStreamMessage callback on the remote client, from which the remote user gets the stream message. A failed method call triggers the onStreamMessageError callback on the remote client.
547
546
  * Ensure that you call createDataStreamEx to create a data channel before calling this method.
548
547
  * This method applies only to the COMMUNICATION profile or to the hosts in the LIVE_BROADCASTING profile. If an audience in the LIVE_BROADCASTING profile calls this method, the audience may be switched to a host.
549
548
  *
@@ -622,7 +621,7 @@ export abstract class IRtcEngineEx extends IRtcEngine {
622
621
  *
623
622
  * @param interval Sets the time interval between two consecutive volume indications:
624
623
  * ≤ 0: Disables the volume indication.
625
- * > 0: Time interval (ms) between two consecutive volume indications. The lowest value is 50.
624
+ * > 0: Time interval (ms) between two consecutive volume indications. Ensure this parameter is set to a value greater than 10, otherwise you will not receive the onAudioVolumeIndication callback. Agora recommends that this value is set as greater than 100.
626
625
  * @param smooth The smoothing factor that sets the sensitivity of the audio volume indicator. The value ranges between 0 and 10. The recommended value is 3. The greater the value, the more sensitive the indicator.
627
626
  * @param reportVad true : Enables the voice activity detection of the local user. Once it is enabled, the vad parameter of the onAudioVolumeIndication callback reports the voice activity status of the local user. false : (Default) Disables the voice activity detection of the local user. Once it is disabled, the vad parameter of the onAudioVolumeIndication callback does not report the voice activity status of the local user, except for the scenario where the engine automatically detects the voice activity of the local user.
628
627
  * @param connection The connection information. See RtcConnection.
@@ -651,9 +650,9 @@ export abstract class IRtcEngineEx extends IRtcEngine {
651
650
  * @returns
652
651
  * 0: Success.
653
652
  * < 0: Failure.
654
- * -2: The URL is null or the string length is 0.
653
+ * -2: The URL or configuration of transcoding is invalid; check your URL and transcoding configurations.
655
654
  * -7: The SDK is not initialized before calling this method.
656
- * -19: The Media Push URL is already in use, use another URL instead.
655
+ * -19: The Media Push URL is already in use; use another URL instead.
657
656
  */
658
657
  abstract startRtmpStreamWithoutTranscodingEx(
659
658
  url: string,
@@ -676,9 +675,9 @@ export abstract class IRtcEngineEx extends IRtcEngine {
676
675
  * @returns
677
676
  * 0: Success.
678
677
  * < 0: Failure.
679
- * -2: The URL is null or the string length is 0.
678
+ * -2: The URL or configuration of transcoding is invalid; check your URL and transcoding configurations.
680
679
  * -7: The SDK is not initialized before calling this method.
681
- * -19: The Media Push URL is already in use, use another URL instead.
680
+ * -19: The Media Push URL is already in use; use another URL instead.
682
681
  */
683
682
  abstract startRtmpStreamWithTranscodingEx(
684
683
  url: string,
@@ -743,51 +742,6 @@ export abstract class IRtcEngineEx extends IRtcEngine {
743
742
  connection: RtcConnection
744
743
  ): number;
745
744
 
746
- /**
747
- * Starts relaying media streams across channels. This method can be used to implement scenarios such as co-host across channels.
748
- *
749
- * Deprecated: This method is deprecated. Use startOrUpdateChannelMediaRelayEx instead. After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged and onChannelMediaRelayEvent callbacks, and these callbacks return the state and events of the media stream relay.
750
- * If the onChannelMediaRelayStateChanged callback returns RelayStateRunning (2) and RelayOk (0), and the onChannelMediaRelayEvent callback returns RelayEventPacketSentToDestChannel (4), it means that the SDK starts relaying media streams between the source channel and the target channel.
751
- * If the onChannelMediaRelayStateChanged callback returns RelayStateFailure (3), an exception occurs during the media stream relay.
752
- * Call this method after joining the channel.
753
- * This method takes effect only when you are a host in a live streaming channel.
754
- * After a successful method call, if you want to call this method again, ensure that you call the stopChannelMediaRelayEx method to quit the current relay.
755
- * The relaying media streams across channels function needs to be enabled by contacting.
756
- * Agora does not support string user accounts in this API.
757
- *
758
- * @param configuration The configuration of the media stream relay. See ChannelMediaRelayConfiguration.
759
- * @param connection The connection information. See RtcConnection.
760
- *
761
- * @returns
762
- * 0: Success.
763
- * < 0: Failure.
764
- * -1: A general error occurs (no specified reason).
765
- * -2: The parameter is invalid.
766
- * -7: The method call was rejected. It may be because the SDK has not been initialized successfully, or the user role is not a host.
767
- * -8: Internal state error. Probably because the user is not a broadcaster.
768
- */
769
- abstract startChannelMediaRelayEx(
770
- configuration: ChannelMediaRelayConfiguration,
771
- connection: RtcConnection
772
- ): number;
773
-
774
- /**
775
- * Updates the channels for media stream relay.
776
- *
777
- * Deprecated: This method is deprecated. Use startOrUpdateChannelMediaRelayEx instead. After the media relay starts, if you want to relay the media stream to more channels, or leave the current relay channel, you can call this method. After a successful method call, the SDK triggers the onChannelMediaRelayEvent callback with the RelayEventPacketUpdateDestChannel (7) state code. Call the method after successfully calling the startChannelMediaRelayEx method and receiving onChannelMediaRelayStateChanged (RelayStateRunning, RelayOk); otherwise, the method call fails.
778
- *
779
- * @param configuration The configuration of the media stream relay. See ChannelMediaRelayConfiguration.
780
- * @param connection The connection information. See RtcConnection.
781
- *
782
- * @returns
783
- * 0: Success.
784
- * < 0: Failure.
785
- */
786
- abstract updateChannelMediaRelayEx(
787
- configuration: ChannelMediaRelayConfiguration,
788
- connection: RtcConnection
789
- ): number;
790
-
791
745
  /**
792
746
  * Stops the media stream relay. Once the relay stops, the host quits all the target channels.
793
747
  *
@@ -848,7 +802,7 @@ export abstract class IRtcEngineEx extends IRtcEngine {
848
802
  * Low-quality video stream: Low bitrate, low resolution. This method is applicable to all types of streams from the sender, including but not limited to video streams collected from cameras, screen sharing streams, and custom-collected video streams.
849
803
  *
850
804
  * @param enabled Whether to enable dual-stream mode: true : Enable dual-stream mode. false : (Default) Disable dual-stream mode.
851
- * @param streamConfig The configuration of the low-quality video stream. See SimulcastStreamConfig.
805
+ * @param streamConfig The configuration of the low-quality video stream. See SimulcastStreamConfig. When setting mode to DisableSimulcastStream, setting streamConfig will not take effect.
852
806
  * @param connection The connection information. See RtcConnection.
853
807
  *
854
808
  * @returns
@@ -864,13 +818,15 @@ export abstract class IRtcEngineEx extends IRtcEngine {
864
818
  /**
865
819
  * Sets the dual-stream mode on the sender side.
866
820
  *
867
- * The SDK enables the low-quality video stream auto mode on the sender by default, which is equivalent to calling this method and setting the mode to AutoSimulcastStream. If you want to modify this behavior, you can call this method and modify the mode to DisableSimulcastStream (never send low-quality video streams) or EnableSimulcastStream (always send low-quality video streams). The difference and connection between this method and enableDualStreamModeEx is as follows:
821
+ * The SDK defaults to enabling low-quality video stream adaptive mode (AutoSimulcastStream) on the sender side, which means the sender does not actively send low-quality video stream. The receiver can initiate a low-quality video stream request by calling setRemoteVideoStreamTypeEx, and the sender will automatically start sending low-quality video stream upon receiving the request.
822
+ * If you want to modify this behavior, you can call this method and set mode to DisableSimulcastStream (never send low-quality video streams) or EnableSimulcastStream (always send low-quality video streams).
823
+ * If you want to restore the default behavior after making changes, you can call this method again with mode set to AutoSimulcastStream. The difference and connection between this method and enableDualStreamModeEx is as follows:
868
824
  * When calling this method and setting mode to DisableSimulcastStream, it has the same effect as enableDualStreamModeEx (false).
869
825
  * When calling this method and setting mode to EnableSimulcastStream, it has the same effect as enableDualStreamModeEx (true).
870
826
  * Both methods can be called before and after joining a channel. If both methods are used, the settings in the method called later takes precedence.
871
827
  *
872
828
  * @param mode The mode in which the video stream is sent. See SimulcastStreamMode.
873
- * @param streamConfig The configuration of the low-quality video stream. See SimulcastStreamConfig.
829
+ * @param streamConfig The configuration of the low-quality video stream. See SimulcastStreamConfig. When setting mode to DisableSimulcastStream, setting streamConfig will not take effect.
874
830
  * @param connection The connection information. See RtcConnection.
875
831
  *
876
832
  * @returns
@@ -949,4 +905,12 @@ export abstract class IRtcEngineEx extends IRtcEngine {
949
905
  * < 0: Failure.
950
906
  */
951
907
  abstract startMediaRenderingTracingEx(connection: RtcConnection): number;
908
+
909
+ /**
910
+ * @ignore
911
+ */
912
+ abstract setParametersEx(
913
+ connection: RtcConnection,
914
+ parameters: string
915
+ ): number;
952
916
  }
@@ -62,78 +62,80 @@ export class SpatialAudioZone {
62
62
  }
63
63
 
64
64
  /**
65
- * This class contains some of the APIs in the ILocalSpatialAudioEngine class.
65
+ * This class calculates user positions through the SDK to implement the spatial audio effect.
66
66
  *
67
- * The ILocalSpatialAudioEngine class inherits from IBaseSpatialAudioEngine.
67
+ * This class inherits from IBaseSpatialAudioEngine. Before calling other APIs in this class, you need to call the initialize method to initialize this class.
68
68
  */
69
- export abstract class IBaseSpatialAudioEngine {
69
+ export abstract class ILocalSpatialAudioEngine {
70
70
  /**
71
- * Destroys IBaseSpatialAudioEngine.
72
- *
73
- * This method releases all resources under IBaseSpatialAudioEngine. When the user does not need to use the spatial audio effect, you can call this method to release resources for other operations. After calling this method, you can no longer use any of the APIs under IBaseSpatialAudioEngine. Call this method before the release method under IRtcEngine.
71
+ * @ignore
74
72
  */
75
73
  abstract release(): void;
76
74
 
77
75
  /**
78
- * Sets the maximum number of streams that a user can receive in a specified audio reception range.
79
- *
80
- * If the number of receivable streams exceeds the set value, the local user receives the maxCount streams that are closest to the local user.
76
+ * Initializes ILocalSpatialAudioEngine.
81
77
  *
82
- * @param maxCount The maximum number of streams that a user can receive within a specified audio reception range. The value of this parameter should be ≤ 16, and the default value is 10.
78
+ * Before calling other methods of the ILocalSpatialAudioEngine class, you need to call this method to initialize ILocalSpatialAudioEngine.
79
+ * The SDK supports creating only one ILocalSpatialAudioEngine instance for an app.
83
80
  *
84
81
  * @returns
85
82
  * 0: Success.
86
83
  * < 0: Failure.
87
84
  */
88
- abstract setMaxAudioRecvCount(maxCount: number): number;
85
+ abstract initialize(): number;
89
86
 
90
87
  /**
91
- * Sets the audio reception range of the local user.
88
+ * Updates the spatial position of the specified remote user.
92
89
  *
93
- * After the setting is successful, the local user can only hear the remote users within the setting range or belonging to the same team. You can call this method at any time to update the audio reception range.
90
+ * After successfully calling this method, the SDK calculates the spatial audio parameters based on the relative position of the local and remote user. Call this method after joinChannel.
94
91
  *
95
- * @param range The maximum audio reception range. The unit is meters. The value of this parameter must be greater than 0, and the default value is 20.
92
+ * @param uid The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.
93
+ * @param posInfo The spatial position of the remote user. See RemoteVoicePositionInfo.
96
94
  *
97
95
  * @returns
98
96
  * 0: Success.
99
97
  * < 0: Failure.
100
98
  */
101
- abstract setAudioRecvRange(range: number): number;
99
+ abstract updateRemotePosition(
100
+ uid: number,
101
+ posInfo: RemoteVoicePositionInfo
102
+ ): number;
102
103
 
103
104
  /**
104
- * Sets the length (in meters) of the game engine distance per unit.
105
- *
106
- * In a game engine, the unit of distance is customized, while in the Agora spatial audio algorithm, distance is measured in meters. By default, the SDK converts the game engine distance per unit to one meter. You can call this method to convert the game engine distance per unit to a specified number of meters.
107
- *
108
- * @param unit The number of meters that the game engine distance per unit is equal to. The value of this parameter must be greater than 0.00, and the default value is 1.00. For example, setting unit as 2.00 means the game engine distance per unit equals 2 meters. The larger the value is, the faster the sound heard by the local user attenuates when the remote user moves far away from the local user.
109
- *
110
- * @returns
111
- * 0: Success.
112
- * < 0: Failure.
105
+ * @ignore
113
106
  */
114
- abstract setDistanceUnit(unit: number): number;
107
+ abstract updateRemotePositionEx(
108
+ uid: number,
109
+ posInfo: RemoteVoicePositionInfo,
110
+ connection: RtcConnection
111
+ ): number;
115
112
 
116
113
  /**
117
- * Updates the spatial position of the local user.
114
+ * Removes the spatial position of the specified remote user.
118
115
  *
119
- * Under the ILocalSpatialAudioEngine class, this method needs to be used with updateRemotePosition. The SDK calculates the relative position between the local and remote users according to this method and the parameter settings in updateRemotePosition, and then calculates the user's spatial audio effect parameters.
116
+ * After successfully calling this method, the local user no longer hears the specified remote user. After leaving the channel, to avoid wasting resources, you can also call this method to delete the spatial position of the specified remote user.
120
117
  *
121
- * @param position The coordinates in the world coordinate system. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
122
- * @param axisForward The unit vector of the x axis in the coordinate system. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
123
- * @param axisRight The unit vector of the y axis in the coordinate system. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
124
- * @param axisUp The unit vector of the z axis in the coordinate system. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
118
+ * @param uid The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.
125
119
  *
126
120
  * @returns
127
121
  * 0: Success.
128
122
  * < 0: Failure.
129
123
  */
130
- abstract updateSelfPosition(
131
- position: number[],
132
- axisForward: number[],
133
- axisRight: number[],
134
- axisUp: number[]
124
+ abstract removeRemotePosition(uid: number): number;
125
+
126
+ /**
127
+ * @ignore
128
+ */
129
+ abstract removeRemotePositionEx(
130
+ uid: number,
131
+ connection: RtcConnection
135
132
  ): number;
136
133
 
134
+ /**
135
+ * @ignore
136
+ */
137
+ abstract clearRemotePositionsEx(connection: RtcConnection): number;
138
+
137
139
  /**
138
140
  * @ignore
139
141
  */
@@ -146,16 +148,32 @@ export abstract class IBaseSpatialAudioEngine {
146
148
  ): number;
147
149
 
148
150
  /**
149
- * Updates the spatial position of the media player.
150
- *
151
- * After a successful update, the local user can hear the change in the spatial position of the media player.
152
- *
153
- * @param playerId The ID of the media player.
154
- * @param positionInfo The spatial position of the media player. See RemoteVoicePositionInfo.
155
- *
156
- * @returns
157
- * 0: Success.
158
- * < 0: Failure.
151
+ * @ignore
152
+ */
153
+ abstract setMaxAudioRecvCount(maxCount: number): number;
154
+
155
+ /**
156
+ * @ignore
157
+ */
158
+ abstract setAudioRecvRange(range: number): number;
159
+
160
+ /**
161
+ * @ignore
162
+ */
163
+ abstract setDistanceUnit(unit: number): number;
164
+
165
+ /**
166
+ * @ignore
167
+ */
168
+ abstract updateSelfPosition(
169
+ position: number[],
170
+ axisForward: number[],
171
+ axisRight: number[],
172
+ axisUp: number[]
173
+ ): number;
174
+
175
+ /**
176
+ * @ignore
159
177
  */
160
178
  abstract updatePlayerPositionInfo(
161
179
  playerId: number,
@@ -168,156 +186,55 @@ export abstract class IBaseSpatialAudioEngine {
168
186
  abstract setParameters(params: string): number;
169
187
 
170
188
  /**
171
- * Stops or resumes publishing the local audio stream.
172
- *
173
- * This method does not affect any ongoing audio recording, because it does not disable the audio capture device.
174
- * Call this method after joinChannel.
175
- * When using the spatial audio effect, if you need to set whether to stop subscribing to the audio stream of a specified user, Agora recommends calling this method instead of the muteLocalAudioStream method in IRtcEngine.
176
- * A successful call of this method triggers the onUserMuteAudio and onRemoteAudioStateChanged callbacks on the remote client.
177
- *
178
- * @param mute Whether to stop publishing the local audio stream: true : Stop publishing the local audio stream. false : Publish the local audio stream.
179
- *
180
- * @returns
181
- * 0: Success.
182
- * < 0: Failure.
189
+ * @ignore
183
190
  */
184
191
  abstract muteLocalAudioStream(mute: boolean): number;
185
192
 
186
193
  /**
187
- * Stops or resumes subscribing to the audio streams of all remote users.
188
- *
189
- * After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users.
190
- * Call this method after joinChannel.
191
- * When using the spatial audio effect, if you need to set whether to stop subscribing to the audio streams of all remote users, Agora recommends calling this method instead of the muteAllRemoteAudioStreams method in IRtcEngine.
192
- * After calling this method, you need to call updateSelfPosition and updateRemotePosition to update the spatial location of the local user and the remote user; otherwise, the settings in this method do not take effect.
193
- *
194
- * @param mute Whether to stop subscribing to the audio streams of all remote users: true : Stop subscribing to the audio streams of all remote users. false : Subscribe to the audio streams of all remote users.
195
- *
196
- * @returns
197
- * 0: Success.
198
- * < 0: Failure.
194
+ * @ignore
199
195
  */
200
196
  abstract muteAllRemoteAudioStreams(mute: boolean): number;
201
197
 
202
198
  /**
203
- * Sets the sound insulation area.
204
- *
205
- * In virtual interactive scenarios, you can use this method to set the sound insulation area and sound attenuation coefficient. When the sound source (which can be the user or the media player) and the listener belong to the inside and outside of the sound insulation area, they can experience the attenuation effect of sound similar to the real environment when it encounters a building partition.
206
- * When the sound source and the listener belong to the inside and outside of the sound insulation area, the sound attenuation effect is determined by the sound attenuation coefficient in SpatialAudioZone.
207
- * If the user or media player is in the same sound insulation area, it is not affected by SpatialAudioZone, and the sound attenuation effect is determined by the attenuation parameter in setPlayerAttenuation or setRemoteAudioAttenuation. If you do not call setPlayerAttenuation or setRemoteAudioAttenuation, the default sound attenuation coefficient of the SDK is 0.5, which simulates the attenuation of the sound in the real environment.
208
- * If the sound source and the receiver belong to two sound insulation areas, the receiver cannot hear the sound source. If this method is called multiple times, the last sound insulation area set takes effect.
209
- *
210
- * @param zones Sound insulation area settings. See SpatialAudioZone. On the Windows platform, it is necessary to ensure that the number of members in the zones array is equal to the value of zoneCount; otherwise, it may cause a crash.
211
- * @param zoneCount The number of sound insulation areas.
212
- *
213
- * @returns
214
- * 0: Success.
215
- * < 0: Failure.
199
+ * @ignore
216
200
  */
217
- abstract setZones(zones: SpatialAudioZone[], zoneCount: number): number;
201
+ abstract muteRemoteAudioStream(uid: number, mute: boolean): number;
218
202
 
219
203
  /**
220
- * Sets the sound attenuation properties of the media player.
204
+ * Sets the sound attenuation effect for the specified user.
221
205
  *
222
- * @param playerId The ID of the media player.
223
- * @param attenuation The sound attenuation coefficient of the remote user or media player. The value range is [0,1]. The values are as follows:
206
+ * @param uid The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.
207
+ * @param attenuation For the user's sound attenuation coefficient, the value range is [0,1]. The values are as follows:
224
208
  * 0: Broadcast mode, where the volume and timbre are not attenuated with distance, and the volume and timbre heard by local users do not change regardless of distance.
225
209
  * (0,0.5): Weak attenuation mode, that is, the volume and timbre are only weakly attenuated during the propagation process, and the sound can travel farther than the real environment.
226
210
  * 0.5: (Default) simulates the attenuation of the volume in the real environment; the effect is equivalent to not setting the speaker_attenuation parameter.
227
211
  * (0.5,1]: Strong attenuation mode, that is, the volume and timbre attenuate rapidly during the propagation process.
228
- * @param forceSet Whether to force the sound attenuation effect of the media player: true : Force attenuation to set the attenuation of the media player. At this time, the attenuation coefficient of the sound insulation are set in the audioAttenuation in the SpatialAudioZone does not take effect for the media player. false : Do not force attenuation to set the sound attenuation effect of the media player, as shown in the following two cases.
212
+ * @param forceSet Whether to force the user's sound attenuation effect: true : Force attenuation to set the sound attenuation of the user. At this time, the attenuation coefficient of the sound insulation area set in the audioAttenuation of the SpatialAudioZone does not take effect for the user.
229
213
  * If the sound source and listener are inside and outside the sound isolation area, the sound attenuation effect is determined by the audioAttenuation in SpatialAudioZone.
230
- * If the sound source and the listener are in the same sound insulation area or outside the same sound insulation area, the sound attenuation effect is determined by attenuation in this method.
214
+ * If the sound source and the listener are in the same sound insulation area or outside the same sound insulation area, the sound attenuation effect is determined by attenuation in this method. false : Do not force attenuation to set the user's sound attenuation effect, as shown in the following two cases.
231
215
  *
232
216
  * @returns
233
217
  * 0: Success.
234
218
  * < 0: Failure.
235
219
  */
236
- abstract setPlayerAttenuation(
237
- playerId: number,
220
+ abstract setRemoteAudioAttenuation(
221
+ uid: number,
238
222
  attenuation: number,
239
223
  forceSet: boolean
240
224
  ): number;
241
225
 
242
- /**
243
- * Stops or resumes subscribing to the audio stream of a specified user.
244
- *
245
- * Call this method after joinChannel.
246
- * When using the spatial audio effect, if you need to set whether to stop subscribing to the audio stream of a specified user, Agora recommends calling this method instead of the muteRemoteAudioStream method in IRtcEngine.
247
- *
248
- * @param uid The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.
249
- * @param mute Whether to subscribe to the specified remote user's audio stream. true : Stop subscribing to the audio stream of the specified user. false : (Default) Subscribe to the audio stream of the specified user. The SDK decides whether to subscribe according to the distance between the local user and the remote user.
250
- *
251
- * @returns
252
- * 0: Success.
253
- * < 0: Failure.
254
- */
255
- abstract muteRemoteAudioStream(uid: number, mute: boolean): number;
256
- }
257
-
258
- /**
259
- * This class calculates user positions through the SDK to implement the spatial audio effect.
260
- *
261
- * This class inherits from IBaseSpatialAudioEngine. Before calling other APIs in this class, you need to call the initialize method to initialize this class.
262
- */
263
- export abstract class ILocalSpatialAudioEngine extends IBaseSpatialAudioEngine {
264
- /**
265
- * Initializes ILocalSpatialAudioEngine.
266
- *
267
- * Before calling other methods of the ILocalSpatialAudioEngine class, you need to call this method to initialize ILocalSpatialAudioEngine.
268
- * The SDK supports creating only one ILocalSpatialAudioEngine instance for an app.
269
- *
270
- * @returns
271
- * 0: Success.
272
- * < 0: Failure.
273
- */
274
- abstract initialize(): number;
275
-
276
- /**
277
- * Updates the spatial position of the specified remote user.
278
- *
279
- * After successfully calling this method, the SDK calculates the spatial audio parameters based on the relative position of the local and remote user. Call this method after joinChannel.
280
- *
281
- * @param uid The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.
282
- * @param posInfo The spatial position of the remote user. See RemoteVoicePositionInfo.
283
- *
284
- * @returns
285
- * 0: Success.
286
- * < 0: Failure.
287
- */
288
- abstract updateRemotePosition(
289
- uid: number,
290
- posInfo: RemoteVoicePositionInfo
291
- ): number;
292
-
293
226
  /**
294
227
  * @ignore
295
228
  */
296
- abstract updateRemotePositionEx(
297
- uid: number,
298
- posInfo: RemoteVoicePositionInfo,
299
- connection: RtcConnection
300
- ): number;
301
-
302
- /**
303
- * Removes the spatial position of the specified remote user.
304
- *
305
- * After successfully calling this method, the local user no longer hears the specified remote user. After leaving the channel, to avoid wasting resources, you can also call this method to delete the spatial position of the specified remote user.
306
- *
307
- * @param uid The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.
308
- *
309
- * @returns
310
- * 0: Success.
311
- * < 0: Failure.
312
- */
313
- abstract removeRemotePosition(uid: number): number;
229
+ abstract setZones(zones: SpatialAudioZone[], zoneCount: number): number;
314
230
 
315
231
  /**
316
232
  * @ignore
317
233
  */
318
- abstract removeRemotePositionEx(
319
- uid: number,
320
- connection: RtcConnection
234
+ abstract setPlayerAttenuation(
235
+ playerId: number,
236
+ attenuation: number,
237
+ forceSet: boolean
321
238
  ): number;
322
239
 
323
240
  /**
@@ -330,32 +247,4 @@ export abstract class ILocalSpatialAudioEngine extends IBaseSpatialAudioEngine {
330
247
  * < 0: Failure.
331
248
  */
332
249
  abstract clearRemotePositions(): number;
333
-
334
- /**
335
- * @ignore
336
- */
337
- abstract clearRemotePositionsEx(connection: RtcConnection): number;
338
-
339
- /**
340
- * Sets the sound attenuation effect for the specified user.
341
- *
342
- * @param uid The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.
343
- * @param attenuation For the user's sound attenuation coefficient, the value range is [0,1]. The values are as follows:
344
- * 0: Broadcast mode, where the volume and timbre are not attenuated with distance, and the volume and timbre heard by local users do not change regardless of distance.
345
- * (0,0.5): Weak attenuation mode, that is, the volume and timbre are only weakly attenuated during the propagation process, and the sound can travel farther than the real environment.
346
- * 0.5: (Default) simulates the attenuation of the volume in the real environment; the effect is equivalent to not setting the speaker_attenuation parameter.
347
- * (0.5,1]: Strong attenuation mode, that is, the volume and timbre attenuate rapidly during the propagation process.
348
- * @param forceSet Whether to force the user's sound attenuation effect: true : Force attenuation to set the sound attenuation of the user. At this time, the attenuation coefficient of the sound insulation area set in the audioAttenuation of the SpatialAudioZone does not take effect for the user.
349
- * If the sound source and listener are inside and outside the sound isolation area, the sound attenuation effect is determined by the audioAttenuation in SpatialAudioZone.
350
- * If the sound source and the listener are in the same sound insulation area or outside the same sound insulation area, the sound attenuation effect is determined by attenuation in this method. false : Do not force attenuation to set the user's sound attenuation effect, as shown in the following two cases.
351
- *
352
- * @returns
353
- * 0: Success.
354
- * < 0: Failure.
355
- */
356
- abstract setRemoteAudioAttenuation(
357
- uid: number,
358
- attenuation: number,
359
- forceSet: boolean
360
- ): number;
361
250
  }
@@ -63,12 +63,23 @@ export abstract class IAudioDeviceManager {
63
63
  abstract getPlaybackDeviceInfo(): AudioDeviceInfo;
64
64
 
65
65
  /**
66
- * @ignore
66
+ * Sets the volume of the audio playback device.
67
+ *
68
+ * This method applies to Windows only.
69
+ *
70
+ * @param volume The volume of the audio playback device. The value range is [0,255].
71
+ *
72
+ * @returns
73
+ * 0: Success.
74
+ * < 0: Failure.
67
75
  */
68
76
  abstract setPlaybackDeviceVolume(volume: number): number;
69
77
 
70
78
  /**
71
- * @ignore
79
+ * Retrieves the volume of the audio playback device.
80
+ *
81
+ * @returns
82
+ * The volume of the audio playback device. The value range is [0,255].
72
83
  */
73
84
  abstract getPlaybackDeviceVolume(): number;
74
85
 
@@ -115,7 +126,12 @@ export abstract class IAudioDeviceManager {
115
126
  abstract setRecordingDeviceVolume(volume: number): number;
116
127
 
117
128
  /**
118
- * @ignore
129
+ * Retrieves the volume of the audio recording device.
130
+ *
131
+ * This method applies to Windows only.
132
+ *
133
+ * @returns
134
+ * The volume of the audio recording device. The value range is [0,255].
119
135
  */
120
136
  abstract getRecordingDeviceVolume(): number;
121
137
 
@@ -177,8 +193,7 @@ export abstract class IAudioDeviceManager {
177
193
  /**
178
194
  * Starts the audio playback device test.
179
195
  *
180
- * This method tests whether the audio playback device works properly. Once a user starts the test, the SDK plays an audio file specified by the user. If the user can hear the audio, the playback device works properly. After calling this method, the SDK triggers the onAudioVolumeIndication callback every 100 ms, reporting uid = 1 and the volume information of the playback device.
181
- * Ensure that you call this method before joining a channel.
196
+ * This method tests whether the audio device for local playback works properly. Once a user starts the test, the SDK plays an audio file specified by the user. If the user can hear the audio, the playback device works properly. After calling this method, the SDK triggers the onAudioVolumeIndication callback every 100 ms, reporting uid = 1 and the volume information of the playback device. The difference between this method and the startEchoTest method is that the former checks if the local audio playback device is working properly, while the latter can check the audio and video devices and network conditions. Ensure that you call this method before joining a channel. After the test is completed, call stopPlaybackDeviceTest to stop the test before joining a channel.
182
197
  *
183
198
  * @param testAudioFilePath The path of the audio file. The data format is string in UTF-8.
184
199
  * Supported file formats: wav, mp3, m4a, and aac.
@@ -193,8 +208,7 @@ export abstract class IAudioDeviceManager {
193
208
  /**
194
209
  * Stops the audio playback device test.
195
210
  *
196
- * This method stops the audio playback device test. You must call this method to stop the test after calling the startPlaybackDeviceTest method.
197
- * Ensure that you call this method before joining a channel.
211
+ * This method stops the audio playback device test. You must call this method to stop the test after calling the startPlaybackDeviceTest method. Ensure that you call this method before joining a channel.
198
212
  *
199
213
  * @returns
200
214
  * 0: Success.
@@ -203,24 +217,23 @@ export abstract class IAudioDeviceManager {
203
217
  abstract stopPlaybackDeviceTest(): number;
204
218
 
205
219
  /**
206
- * Starts the audio capture device test.
220
+ * Starts the audio capturing device test.
207
221
  *
208
- * This method tests whether the audio capture device works properly. After calling this method, the SDK triggers the onAudioVolumeIndication callback at the time interval set in this method, which reports uid = 0 and the volume information of the capturing device.
209
- * Ensure that you call this method before joining a channel.
222
+ * This method tests whether the audio capturing device works properly. After calling this method, the SDK triggers the onAudioVolumeIndication callback at the time interval set in this method, which reports uid = 0 and the volume information of the capturing device. The difference between this method and the startEchoTest method is that the former checks if the local audio capturing device is working properly, while the latter can check the audio and video devices and network conditions. Ensure that you call this method before joining a channel. After the test is completed, call stopRecordingDeviceTest to stop the test before joining a channel.
210
223
  *
211
- * @param indicationInterval The time interval (ms) at which the SDK triggers the onAudioVolumeIndication callback. Agora recommends setting a value greater than 200 ms. This value must not be less than 10 ms; otherwise, you can not receive the onAudioVolumeIndication callback.
224
+ * @param indicationInterval The interval (ms) for triggering the onAudioVolumeIndication callback. This value should be set to greater than 10, otherwise, you will not receive the onAudioVolumeIndication callback and the SDK returns the error code -2. Agora recommends that you set this value to 100.
212
225
  *
213
226
  * @returns
214
227
  * 0: Success.
215
228
  * < 0: Failure.
229
+ * -2: Invalid parameters. Check your parameter settings.
216
230
  */
217
231
  abstract startRecordingDeviceTest(indicationInterval: number): number;
218
232
 
219
233
  /**
220
- * Stops the audio capture device test.
234
+ * Stops the audio capturing device test.
221
235
  *
222
- * This method stops the audio capture device test. You must call this method to stop the test after calling the startRecordingDeviceTest method.
223
- * Ensure that you call this method before joining a channel.
236
+ * This method stops the audio capturing device test. You must call this method to stop the test after calling the startRecordingDeviceTest method. Ensure that you call this method before joining a channel.
224
237
  *
225
238
  * @returns
226
239
  * 0: Success.