Voice SDK v3.7.1 API Reference for Unity
Public Member Functions | List of all members
agora_gaming_rtc.AudioRecordingDeviceManager Class Reference

Inherits agora_gaming_rtc.IAudioRecordingDeviceManager.

Public Member Functions

override bool  CreateAAudioRecordingDeviceManager ()
 
override int  ReleaseAAudioRecordingDeviceManager ()
 
override int  GetAudioRecordingDeviceCount ()
 
override int  GetAudioRecordingDevice (int index, ref string audioRecordingDeviceName, ref string audioRecordingDeviceId)
 
override int  GetAudioRecordingDefaultDevice (ref string deviceName, ref string deviceId)
 
override int  GetCurrentRecordingDevice (ref string deviceId)
 
override int  SetAudioRecordingDeviceVolume (int volume)
 
override int  GetAudioRecordingDeviceVolume ()
 
override int  SetAudioRecordingDeviceMute (bool mute)
 
override bool  IsAudioRecordingDeviceMute ()
 
override int  SetAudioRecordingDevice (string deviceId)
 
override int  StartAudioRecordingDeviceTest (int indicationInterval)
 
override int  StopAudioRecordingDeviceTest ()
 
override int  GetCurrentRecordingDeviceInfo (ref string deviceName, ref string deviceId)
 
override int  FollowSystemRecordingDevice (bool enable)
 
override int  StartAudioDeviceLoopbackTest (int indicationInterval)
 
override int  StopAudioDeviceLoopbackTest ()
 

Detailed Description

The definition of AudioRecordingDeviceManager. The APIs of this class are only available on Windows and macOS.

Member Function Documentation

◆ CreateAAudioRecordingDeviceManager()

override bool agora_gaming_rtc.AudioRecordingDeviceManager.CreateAAudioRecordingDeviceManager ( )
virtual

Create an IAudioRecordingDeviceManager instance.

Note
Ensure that you call ReleaseAAudioRecordingDeviceManager to release this instance after calling this method.
Returns
  • true: Success.
  • false: Failure.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.

◆ FollowSystemRecordingDevice()

override int agora_gaming_rtc.AudioRecordingDeviceManager.FollowSystemRecordingDevice ( bool  enable )
virtual

Sets the audio recording device used by the SDK to follow the system default audio recording device.

Since
v3.6.1.1
Parameters
enable 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.
Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.

◆ GetAudioRecordingDefaultDevice()

override int agora_gaming_rtc.AudioRecordingDeviceManager.GetAudioRecordingDefaultDevice ( ref string  deviceName,
ref string  deviceId 
)
virtual

Gets the default audio recording device of the system.

Parameters
deviceName The name of the system default audio recording device.
deviceId Pointer to the device ID of the audio recording device.
Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.

◆ GetAudioRecordingDevice()

override int agora_gaming_rtc.AudioRecordingDeviceManager.GetAudioRecordingDevice ( int  index,
ref string  audioRecordingDeviceName,
ref string  audioRecordingDeviceId 
)
virtual

Retrieves the audio capturing device associated with the index.

After calling this method, the SDK retrieves the device name and device ID according to the index.

Note
Call GetAudioRecordingDeviceCount before this method.
Parameters
index The index of the capturing device in the system. The value of index is associated with the number of the capturing device which is retrieved from GetAudioRecordingDeviceCount. For example, when the number of capturing devices is 3, the value range of index is [0,2].
audioRecordingDeviceName The name of the capturing device for the corresponding index.
audioRecordingDeviceId The ID of the capturing device for the corresponding index.
Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.

◆ GetAudioRecordingDeviceCount()

override int agora_gaming_rtc.AudioRecordingDeviceManager.GetAudioRecordingDeviceCount ( )
virtual

Retrieves the total number of the indexed audio capturing devices in the system.

Returns
Total number of the indexed audio capturing devices.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.

◆ GetAudioRecordingDeviceVolume()

override int agora_gaming_rtc.AudioRecordingDeviceManager.GetAudioRecordingDeviceVolume ( )
virtual

Retrieves the volume of the current audio capturing device.

Returns
  • ≥ 0: The volume of the current audio capturing device, if this method call succeeds.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.

◆ GetCurrentRecordingDevice()

override int agora_gaming_rtc.AudioRecordingDeviceManager.GetCurrentRecordingDevice ( ref string  deviceId )
virtual

Retrieves the device ID of the current audio capturing device.

Parameters
deviceId The device ID of the current audio capturing device.
Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.

◆ GetCurrentRecordingDeviceInfo()

override int agora_gaming_rtc.AudioRecordingDeviceManager.GetCurrentRecordingDeviceInfo ( ref string  deviceName,
ref string  deviceId 
)
virtual

Retrieves the device information of the current audio capturing device.

Parameters
deviceName The device name of the current audio capturing device.
deviceId The device ID of the current audio capturing device.
Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.

◆ IsAudioRecordingDeviceMute()

override bool agora_gaming_rtc.AudioRecordingDeviceManager.IsAudioRecordingDeviceMute ( )
virtual

Gets the status of the current audio capturing device.

Returns
Whether the current audio capturing device stops audio capturing.
  • true: Stops.
  • false: Doesn't stop.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.

◆ ReleaseAAudioRecordingDeviceManager()

override int agora_gaming_rtc.AudioRecordingDeviceManager.ReleaseAAudioRecordingDeviceManager ( )
virtual

Release an AudioRecordingDeviceManager instance.

Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.

◆ SetAudioRecordingDevice()

override int agora_gaming_rtc.AudioRecordingDeviceManager.SetAudioRecordingDevice ( string  deviceId )
virtual

Sets the audio capturing device using the device ID.

Note
  • Call GetAudioRecordingDevice before this method.
  • Plugging or unplugging the audio device does not change the device ID.
Parameters
deviceId Device ID of the audio capturing device, retrieved by calling GetAudioRecordingDevice.
Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.

◆ SetAudioRecordingDeviceMute()

override int agora_gaming_rtc.AudioRecordingDeviceManager.SetAudioRecordingDeviceMute ( bool  mute )
virtual

Sets whether to stop audio capturing.

Parameters
mute Sets whether to stop audio capturing.
  • true: Stops.
  • false: Doesn't stop.
Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.

◆ SetAudioRecordingDeviceVolume()

override int agora_gaming_rtc.AudioRecordingDeviceManager.SetAudioRecordingDeviceVolume ( int  volume )
virtual

Sets the volume of the current audio capturing device.

Parameters
volume The volume of the current audio capturing device. The value ranges between 0 (lowest volume) and 255 (highest volume).
Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.

◆ StartAudioDeviceLoopbackTest()

override int agora_gaming_rtc.AudioRecordingDeviceManager.StartAudioDeviceLoopbackTest ( int  indicationInterval )
virtual

Starts the audio device loopback test (for macOS and Windows only).

This method tests whether the local audio capturing device and playback device work properly. After calling this method, the audio capturing device samples the local audio, and then the audio playback device plays the sampled audio.

You can call this method either before or after joining a channel. Depending on the call sequence, the SDK triggers the following callbacks at the set time interval to report the volume of the audio capturing device:

The two callbacks report the same volume information. Agora recommends using OnAudioDeviceTestVolumeIndicationHandler.

  • Two OnAudioDeviceTestVolumeIndicationHandler callbacks when you call this method after joining a channel, with the following values:
  • volumeType = AudioTestRecordingVolume(0) and volume in one callback.
  • volumeType = AudioTestPlaybackVolume(1) and volume in the other.
Note
  • When you call this method after joining a channel, ensure the audio capturing device is on (enableLocalAudio is set as true); otherwise, the method call fails.
  • Calling this method after joining a channel tests the audio capturing device that the SDK is using.
  • After calling this method, you must call StopAudioDeviceLoopbackTest to stop the test.
  • This method applies to macOS and Windows only.
Parameters
indicationInterval The time interval (ms) at which the OnVolumeIndicationHandler or OnAudioDeviceTestVolumeIndicationHandler callback returns. Agora recommends a setting greater than 200 ms. This value must be 10 ms or greater; otherwise, you cannot receive the OnVolumeIndicationHandler or OnAudioDeviceTestVolumeIndicationHandler callback.
Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.

◆ StartAudioRecordingDeviceTest()

override int agora_gaming_rtc.AudioRecordingDeviceManager.StartAudioRecordingDeviceTest ( int  indicationInterval )
virtual

Starts the audio capturing device test (for macOS and Windows only).

This method tests whether the audio capturing device works properly.

As of v3.7.0, you can call this method either before or after joining a channel. Depending on the call sequence, the SDK triggers the following callbacks at the set time interval to report the volume of the audio capturing device:

The two callbacks report the same volume information. Agora recommends using onAudioDeviceTestVolumeIndication.

  • onAudioDeviceTestVolumeIndication when you call this method after joining a channel, which reports volumeType = AudioTestRecordingVolume(0) and volume.
Note
  • When you call this method after joining a channel, ensure the audio capturing device is on (enableLocalAudio is set as true); otherwise, the method call fails.
  • Calling this method after joining a channel tests the audio capturing device that the SDK is using.
  • After calling this method, you must call StopAudioRecordingDeviceTest to stop the test.
  • This method applies to macOS and Windows only.
Parameters
indicationInterval The time interval (ms) at which the OnVolumeIndicationHandler or OnAudioDeviceTestVolumeIndicationHandler callback returns. Agora recommends a setting greater than 200 ms. This value must be 10 ms or greater; otherwise, you cannot receive the OnVolumeIndicationHandler or OnAudioDeviceTestVolumeIndicationHandler callback.
Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.

◆ StopAudioDeviceLoopbackTest()

override int agora_gaming_rtc.AudioRecordingDeviceManager.StopAudioDeviceLoopbackTest ( )
virtual

Stops the audio device loopback test (for macOS and Windows only).

Note
Ensure that you call this method to stop the loopback test after calling the StartAudioDeviceLoopbackTest method.
Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.

◆ StopAudioRecordingDeviceTest()

override int agora_gaming_rtc.AudioRecordingDeviceManager.StopAudioRecordingDeviceTest ( )
virtual

Stops the audio capturing device test (for macOS and Windows only).

This method stops the audio capturing device test. You must call this method to stop the test after calling the startRecordingDeviceTest method.

Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRecordingDeviceManager.


The documentation for this class was generated from the following file: