Introduction

Agora supports the media device test and selection feature, allowing you to check if an audio device (a headset, microphone, or speaker) works or connects properly to the SD-RTN. For example, in an audio device test, if a user's recorded voice is replayed in 10 seconds, then the system's audio device works and is connected properly to the SD-RTN.

You can use the media device test and selection feature in the following scenarios:

  • A host self-checks before starting a live broadcast.
  • An online user checks if the media device works.

Implementation

Microphone Test

// Starts the microphone test.
agoraKit.startRecordingDeviceTest(1000)

// Stops the microphone test.
agoraKit.stopRecordingDeviceTest()
[agoraKit startRecordingDeviceTest: 1000];

[agoraKit stopRecordingDeviceTest];

External Playback Device Test

// Starts a playback device test.
agoraKit.startPlaybackDeviceTest("audio file path")

// Stops a playback device test.
agoraKit.stopPlaybackDeviceTest()
[agoraKit startPlaybackDeviceTest: @"audio file path"];

[agoraKit stopPlaybackDeviceTest];

API Reference

Considerations

If the input device fails to initialize, check the error message in Developer Center.