startAudioPlaybackDeviceTest method
@detail api
@brief Start the playback test for the local audio device. RTC will start playing the audio file specified. And RTC will notify the audio volume via the onAudioPlaybackDeviceTestVolume periodically.
@param testAudioFilePath Specify the path of the audio file for the playback test, including *.mp3, *.aac, *.m4a, *.3gp, and *.wav.
@param interval The time interval between each onAudioPlaybackDeviceTestVolume callback in milliseconds. We recommend setting it to 200 ms. The minimal value is 10 ms.
@return
- 0: Success
- < 0: Failure
@note
- You can call this API whether the user is in the room.
- Call stopAudioPlaybackDeviceTest{@link #IRTCAudioDeviceManager#stopAudioPlaybackDeviceTest} to stop the playback test before moving on to the other device tests.
Implementation
Future<int?> startAudioPlaybackDeviceTest(
string testAudioFilePath, int interval) async {
$a() => ($instance as $p_a.IRTCAudioDeviceManager)
.startAudioPlaybackDeviceTest(testAudioFilePath, interval);
$i() => ($instance as $p_i.ByteRTCAudioDeviceManager)
.startAudioPlaybackDeviceTest(testAudioFilePath, interval);
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}