namespace Agora.Rtc
{
///
///
/// Audio device management methods.
///
///
public abstract class IAudioDeviceManager
{
#region PlaybackDevices
///
///
/// Enumerates the audio playback devices.
///
///
///
/// Success: Returns a DeviceInfo array, which includes the device ID and device name of all the audio playback devices.Failure: NULL.
///
///
public abstract DeviceInfo[] EnumeratePlaybackDevices();
///
///
/// Sets the audio playback device.
///
///
/// The ID of the specified audio playback device. You can get the device ID by calling EnumeratePlaybackDevices . Plugging or unplugging the audio device does not change the value of deviceId.
///
///
/// 0: Success.< 0: Failure.
///
///
public abstract int SetPlaybackDevice(string deviceId);
///
///
/// Retrieves the audio playback device associated with the device ID.
///
///
/// Output parameter. The device ID of the audio playback device.
///
///
/// 0: Success.< 0: Failure.
///
///
public abstract int GetPlaybackDevice(ref string deviceId);
///
///
/// Retrieves the audio playback device associated with the device ID.
///
///
/// The device ID of the recording device.
///
/// The device name of the recording device.
///
///
/// 0: Success.< 0: Failure.
///
///
public abstract int GetPlaybackDeviceInfo(ref string deviceId, ref string deviceName);
///
/// @ignore
///
public abstract int SetPlaybackDeviceVolume(int volume);
///
/// @ignore
///
public abstract int GetPlaybackDeviceVolume(ref int volume);
///
/// @ignore
///
public abstract int SetPlaybackDeviceMute(bool mute);
///
/// @ignore
///
public abstract int GetPlaybackDeviceMute(ref bool mute);
///
///
/// Starts the audio playback device test.
/// This method tests whether the audio playback device works properly. Once a user starts the test, the SDK plays an audio file specified by the user. If the user can hear the audio, the playback device works properly.After calling this method, the SDK triggers the OnAudioVolumeIndication callback every 100 ms, reporting uid = 1 and the volume information of the playback device.Ensure that you call this method before joining a channel.
///
///
/// The path of the audio file. The data format is string in UTF-8.Supported file formats: wav, mp3, m4a, and aac.Supported file sample rates: 8000, 16000, 32000, 44100, and 48000 Hz.
///
///
/// 0: Success.< 0: Failure.
///
///
public abstract int StartPlaybackDeviceTest(string testAudioFilePath);
///
///
/// Stops the audio playback device test.
/// This method stops the audio playback device test. You must call this method to stop the test after calling the StartPlaybackDeviceTest method.Ensure that you call this method before joining a channel.
///
///
///
/// 0: Success.< 0: Failure.
///
///
public abstract int StopPlaybackDeviceTest();
///
///
/// Sets the audio playback device used by the SDK to follow the system default audio playback device.
///
///
/// Whether to follow the system default audio playback device:true: Follow. The SDK immediately switches the audio playback device when the system default audio playback device changes.false: Do not follow. The SDK switches the audio playback device to the system default audio playback device only when the currently used audio playback device is disconnected.
///
///
/// 0: Success.< 0: Failure.
///
///
public abstract int FollowSystemPlaybackDevice(bool enable);
#endregion
#region RecordingDevices
///
///
/// Enumerates the audio capture devices.
///
///
///
/// Success: A DeviceInfo array, which includes the device ID and device name of all the audio capture devices.Failure: NULL.
///
///
public abstract DeviceInfo[] EnumerateRecordingDevices();
///
///
/// Sets the audio recording device.
///
///
/// The ID of the audio recording device. You can get the device ID by calling EnumerateRecordingDevices . Plugging or unplugging the audio device does not change the value of deviceId.
///
///
/// 0: Success.< 0: Failure.
///
///
public abstract int SetRecordingDevice(string deviceId);
///
///
/// Gets the current audio recording device.
///
///
/// Output parameter. The device ID of the recording device.
///
///
/// 0: Success.< 0: Failure.
///
///
public abstract int GetRecordingDevice(ref string deviceId);
///
///
/// Retrieves the volume of the audio recording device.
///
///
/// The device ID of the recording device.
///
/// The device name of the recording device.
///
///
/// 0: Success.< 0: Failure.
///
///
public abstract int GetRecordingDeviceInfo(ref string deviceId, ref string deviceName);
///
/// @ignore
///
public abstract int SetRecordingDeviceVolume(int volume);
///
/// @ignore
///
public abstract int GetRecordingDeviceVolume(ref int volume);
///
/// @ignore
///
public abstract int SetRecordingDeviceMute(bool mute);
///
/// @ignore
///
public abstract int GetRecordingDeviceMute(ref bool mute);
///
///
/// Starts the audio capture device test.
/// This method tests whether the audio capture device works properly. After calling this method, the SDK triggers the OnAudioVolumeIndication callback at the time interval set in this method, which reports uid = 0 and the volume information of the capturing device.Ensure that you call this method before joining a channel.
///
///
/// The time interval (ms) at which the SDK triggers the OnAudioVolumeIndication callback. Agora recommends a setting greater than 200 ms. This value must not be less than 10 ms; otherwise, you can not receive the OnAudioVolumeIndication callback.
///
///
/// 0: Success.< 0: Failure.
///
///
public abstract int StartRecordingDeviceTest(int indicationInterval);
///
///
/// Stops the audio capture device test.
/// This method stops the audio capture device test. You must call this method to stop the test after calling the StartRecordingDeviceTest method.Ensure that you call this method before joining a channel.
///
///
///
/// 0: Success.< 0: Failure.
///
///
public abstract int StopRecordingDeviceTest();
///
///
/// Sets the audio recording device used by the SDK to follow the system default audio recording device.
///
///
/// Whether to follow the system default audio recording device:true: Follow. The SDK immediately switches the audio recording device when the system default audio recording device changes.false: Do not follow. The SDK switches the audio recording device to the system default audio recording device only when the currently used audio recording device is disconnected.
///
///
/// 0: Success.< 0: Failure.
///
///
public abstract int FollowSystemRecordingDevice(bool enable);
#endregion
#region AudioDevice
///
///
/// Starts an audio device loopback test.
/// This method tests whether the local audio capture device and playback device are working properly. Once the test starts, the audio recording device records the local audio, and the audio playback device plays the captured audio. The SDK triggers two independent OnAudioVolumeIndication callbacks at the time interval set in this method, which reports the volume information of the capture device (uid = 0) and the volume information of the playback device (uid = 1) respectively.Ensure that you call this method before joining a channel.This method tests local audio devices and does not report the network conditions.
///
///
/// The time interval (ms) at which the SDK triggers the OnAudioVolumeIndication callback. Agora recommends setting a value greater than 200 ms. This value must not be less than 10 ms; otherwise, you can not receive the OnAudioVolumeIndication callback.
///
///
/// 0: Success.< 0: Failure.
///
///
public abstract int StartAudioDeviceLoopbackTest(int indicationInterval);
///
///
/// Stops the audio device loopback test.
/// Ensure that you call this method before joining a channel.Ensure that you call this method to stop the loopback test after calling the StartAudioDeviceLoopbackTest method.
///
///
///
/// 0: Success.< 0: Failure.
///
///
public abstract int StopAudioDeviceLoopbackTest();
#endregion
}
}