setSystemVolumeType method Null safety
- int type
Set the system volume type used in call
Note: this API supports only the Android and iOS platforms
Smartphones usually have two system volume types, i.e., call volume and media volume.
Currently, the SDK provides three control modes of system volume types, including:
-
TRTCCloudDef.TRTCSystemVolumeTypeAuto: "call volume with mic and media volume without mic", i.e., the call volume mode will be used when the anchor mics on, while the media volume mode will be used when the audience user mics off. This is suitable for live streaming scenarios. If the scenario you select during
enterRoom
isTRTCCloudDef.TRTC_APP_SCENE_LIVE
orTRTCCloudDef.TRTC_APP_SCENE_VOICE_CHATROOM
, the SDK will automatically select this mode. -
TRTCCloudDef.TRTCSystemVolumeTypeVOIP: the call volume mode will be used throughout the call, which is suitable for conferencing scenarios. If the scenario you select during
enterRoom
isTRTCCloudDef.TRTC_APP_SCENE_VIDEOCALL
orTRTCCloudDef.TRTC_APP_SCENE_AUDIOCALL
, the SDK will automatically select this mode. -
TRTCCloudDef.TRTCSystemVolumeTypeMedia: the media volume mode is used throughout the call. This is not common and is suitable for scenarios with special requirements (for example, the anchor has an external sound card).
Note:
-
This API must be called before
startLocalAudio()
is called. -
If you have no special requirements, we recommend you not set it by yourself. You just need to set your scenario through
enterRoom
, and the SDK will automatically select the matching volume type internally.
Parameters:
type System volume type. If you have no special requirements, we recommend you not set it by yourself.
Implementation
Future<void> setSystemVolumeType(
int type // System volume type. For more information, please see `TRTCSystemVolumeType`. Default value: TRTCSystemVolumeTypeAuto
) {
return _channel.invokeMethod('setSystemVolumeType', {
"type": type,
});
}