This topic describes how to achieve audio and video interoperation between the native ApsaraVideo Real-time Communication (ARTC) SDK (for Android, iOS, Windows, Linux, or Harmony) and ARTC SDK for Web.
Default settings for interoperation
With the default settings, the native ARTC SDK can seamlessly interoperate with ARTC SDK for Web. After you integrate the native ARTC SDK into your app, you can perform a call test by using the web demo. During the process, make sure that the application ID is consistent, use the web demo as a streamer, and use the same channel number.
SDK interoperation
When the native ARTC SDK and ARTC SDK for Web interoperate using the default settings, the audio sampling rate for transmission is 48 kHz. Make sure that the native ARTC SDK transmits audio at a 48 kHz sampling rate to prevent issues such as fast or slow playback on the web side.
Related API
To use the 48 kHz sampling rate, we recommend that you choose the high audio quality mode in the native ARTC SDK. Examples:
Mobile
Set audio_profile to AliRtcEngineHighQualityMode, and specify audio_scene based on the actual scenario.
Android
public abstract int setAudioProfile(AliRtcAudioProfile profile, AliRtcAudioScenario scenario);iOS
- (int)setAudioProfile:(AliRtcAudioProfile)audio_profile audio_scene:(AliRtcAudioScenario)audio_scene;Harmony
- (int)setAudioProfile:(AliRtcAudioProfile)audio_profile audio_scene:(AliRtcAudioScenario)audio_scene;Windows
Set audioProfile to AliEngineHighQualityMode, and specify audioScene based on the actual scenario.
virtual int SetAudioProfile(int audioProfile, int audioScene) = 0;Linux
Take Python as an example. Set audioProfile to HighQualityMode, and specify audioScene based on the actual scenario.
def SetAudioProfile(audioProfile:AudioQualityMode, audioScene:AudioSceneMode) -> intIf you want even higher-quality audio output with the native ARTC SDK, selecting higher-level modes, such as the ultra-high audio quality mode, still allows normal calls with ARTC SDK for Web.
The setH5CompatibleMode method, which are used by ARTC SDK for Android, iOS, Harmony, and Windows before an engine is created, and the h5mode method, which is used by ARTC SDK for Linux when an engine is created, are deprecated methods and no longer require configuration.