startMicDeviceTestAndPlayback method

int startMicDeviceTestAndPlayback(
  1. int interval,
  2. bool playback
)
override

Starting Mic Testing (for Desktop OS)

This API is used to test whether the mic functions properly. The mic volume detected (value range: 0-100) is returned via a callback.

  • Parameters:
    • interval(int):
      • Interval of volume callbacks.
    • playback(bool):
      • Whether to play back the microphone sound.
      • The user will hear his own sound when testing the microphone if playback is true.

Implementation

int startMicDeviceTestAndPlayback(int interval, bool playback) {
  if (_only_support_desktop) {
    return _deviceFFIBindings.start_mic_device_test_and_playback(_nativePointer, interval, playback);
  } else {
    debugPrint("device-manager-api not support");
    return -1;
  }
}