Scenario-based Audio and Video Configuration
Feature Introduction
To facilitate quick integration for developers and reduce the integration threshold, the SDK has developed various scenario-based configuration solutions through extensive online data verification. Developers can select the corresponding room mode according to the required scenario, and the SDK will automatically apply audio and video codecs, audio and video parameters, flow control strategies, and other configurations suitable for that scenario, thereby quickly achieving the best results in that scenario. Currently supported scenarios include show live streaming, KTV, standard 1v1 audio and video call, high-quality 1v1 audio and video call, standard voice chat room, high-quality voice chat room.
Call Method
In the scenario (ZegoScenario) field of the profile (ZegoEngineProfile) parameter when creating the engine, you need to specify a scenario. You can choose according to your actual audio and video business scenario.
- For users in the same room, it is recommended to use the same room scenario to obtain the best results.
- If your App has multiple audio and video business scenarios, for example, both 1v1 audio and video call scenario and show live streaming scenario. You can, without destroying the engine (destroyEngine), after logging out of the room, switch scenarios by calling setRoomScenario, and then log in to other rooms.
Currently, the SDK supports the following scenarios:
| Scenario (Supported version: 3.0.0 and above) | Scenario Description | Key Configuration Description |
|---|---|---|
| Broadcast | Live streaming scenario, suitable for one-to-many live streaming scenarios such as show, gaming, e-commerce, education large class, etc. Optimized for audio and video quality, smoothness, compatibility, etc. Note: In the live streaming scenario, the SDK does not have business "roles" (such as anchor, audience). All users in the room can publish and play streams. |
|
| StandardVideoCall | Standard audio and video call scenario, suitable for 1v1 video or voice call scenarios. |
|
| HighQualityVideoCall | High-quality audio and video call scenario, similar to the StandardVideoCall scenario, but this scenario adopts higher video configuration by default than the StandardVideoCall scenario, suitable for video call scenarios with higher requirements for picture quality. |
|
| StandardVoiceCall | Standard voice call scenario, suitable for 1v1 pure voice call scenarios. Note: On the Real-time Audio and Video (Express-Video) SDK, this scenario does not enable the camera by default. | - |
| StandardChatroom | Standard voice chat room scenario, suitable for multi-person pure voice calls, saving traffic. Note: On the Real-time Audio and Video (Express-Video) SDK, this scenario does not enable the camera by default. For voice chat room scenarios with music, it is recommended to choose the high-quality voice chat room scenario configuration. | Audio encoder compatibility: Only available for RTC publishing stream. Server transcoding is required when forwarding to CDN. |
| HighQualityChatroom | High-quality voice chat room scenario, similar to the StandardChatroom scenario, but this scenario adopts higher audio configuration by default than the StandardChatroom scenario, suitable for multi-person pure voice call scenarios with higher requirements for audio quality. Note: On the Real-time Audio and Video (Express-Video) SDK, this scenario does not enable the camera by default. | Audio encoder compatibility: Only available for RTC publishing stream. Server transcoding is required when forwarding to CDN. |
| Karaoke | Karaoke (KTV) scenario, suitable for real-time chorus, online K-song scenarios. Optimized for latency, audio quality, ear return, echo cancellation, etc., while also ensuring precise alignment and ultra-low latency during multi-person chorus. Note: On the Real-time Audio and Video (Express-Video) SDK, this scenario does not enable the camera by default. | Audio encoder compatibility: Only available for RTC publishing stream. Server transcoding is required when forwarding to CDN. |
| Default | Default (general) scenario. If none of the above scenario enumerations match the developer's actual application scenario, this default scenario can be used. |
|
Since the following 3 old scenarios have been deprecated, please migrate to the above new scenarios as soon as possible.
- General old general scenario.
- Communication old real-time communication scenario.
- Live old live streaming scenario.
If after specifying a scenario, developers have needs for fine-grained control of SDK audio and video configuration, they can configure through other APIs. The priority is higher than scenario-based configuration. For details, please refer to Common Video Configuration, Traffic Control documentation.
-
Video related configuration
-
Audio related configuration
-
Audio 3A processing related configuration
-
Flow control related configuration
- After logging in to the room, modifying the room scenario is no longer allowed. If you need to switch scenarios, you need to log out of the room first. If you have logged in to multiple rooms, you need to log out of all rooms before switching scenarios. If setRoomScenario is called while already logged in to a room, the call will be invalid, and error code 1000067 will be callbacked through onDebugError.
- After logging out of the room, once switching scenarios through setRoomScenario, all related audio and video fine-grained configurations previously made through the above APIs will be reset to the default values of the new scenario. Therefore, it is recommended to set the scenario first, and then adjust audio and video configuration through other APIs.
- If you have requirements for other scenario settings or configuration questions, please contact ZEGO technical support.
