setLoudness method
@detail api
@brief To call enableVocalInstrumentBalance{@link #RTCEngine#enableVocalInstrumentBalance} to adjust the volume of the mixed media file or the PCM audio data, you must pass in its original loudness through this API.
@param loudness Original loudness in lufs. The range is [-70.0, 0.0].
When the value is less than -70.0lufs, it will be adjusted to -70.0lufs by default, and if it is more than 0.0lufs, the loudness will not be equalized. The default value is 1.0lufs, which means no processing.
@return
- 0: Success.
- < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details.
@note
- Call this API only when audio is mixing.
- The API is valid for audio file and PCM data.
Implementation
Future<int?> setLoudness(float loudness) async {
$a() => ($instance as $p_a.IMediaPlayer).setLoudness(loudness);
$i() => ($instance as $p_i.ByteRTCMediaPlayer).setLoudness(loudness);
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}