setEarMonitorMode method
@detail api @author majun.lvhiei @brief Enables/disables in-ear monitoring. @param mode Whether to enable in-ear monitoring. See EarMonitorMode{@link #EarMonitorMode}. @return - 0: Success. - < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details. @note - In-ear monitoring is effective for audios captured by the RTC SDK. - We recommend that you use wired earbuds/headphones for a low-latency experience. - The RTC SDK supports both hardware-level and SDK-level in-ear monitoring. Hardware-level monitoring typically offers lower latency and better audio quality. If your App is in the manufacturer's trusted list for this feature and the environment meets the required conditions, the RTC SDK will automatically default to hardware-level in-ear monitoring when enabled.
Implementation
Future<int?> setEarMonitorMode(
EarMonitorMode mode, EarMonitorAudioFilter filter) async {
$a() => ($instance as $p_a.RTCEngine).setEarMonitorMode(
t_EarMonitorMode.code_to_android(mode),
t_EarMonitorAudioFilter.code_to_android(filter));
$i() => ($instance as $p_i.ByteRTCEngine).setEarMonitorMode(
t_EarMonitorMode.code_to_ios(mode),
t_EarMonitorAudioFilter.code_to_ios(filter));
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}