Inherits agora_gaming_rtc.IAudioPlaybackDeviceManager.

Public Member Functions

override bool CreateAAudioPlaybackDeviceManager ()
 
override int ReleaseAAudioPlaybackDeviceManager ()
 
override int GetAudioPlaybackDeviceCount ()
 
override int GetAudioPlaybackDevice (int index, ref string deviceName, ref string deviceId)
 
override int GetCurrentPlaybackDevice (ref string deviceId)
 
override int SetAudioPlaybackDevice (string deviceId)
 
override int SetAudioPlaybackDeviceVolume (int volume)
 
override int GetAudioPlaybackDeviceVolume ()
 
override int SetAudioPlaybackDeviceMute (bool mute)
 
override bool IsAudioPlaybackDeviceMute ()
 
override int StartAudioPlaybackDeviceTest (string testAudioFilePath)
 
override int StopAudioPlaybackDeviceTest ()
 
override int GetCurrentPlaybackDeviceInfo (ref string deviceName, ref string deviceId)
 

Detailed Description

The definition of AudioPlaybackDeviceManager.

Member Function Documentation

◆ CreateAAudioPlaybackDeviceManager()

override bool agora_gaming_rtc.AudioPlaybackDeviceManager.CreateAAudioPlaybackDeviceManager ( )

Create an AudioPlaybackDeviceManager instance.

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

◆ ReleaseAAudioPlaybackDeviceManager()

override int agora_gaming_rtc.AudioPlaybackDeviceManager.ReleaseAAudioPlaybackDeviceManager ( )

Release an AudioPlaybackDeviceManager instance.

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

◆ GetAudioPlaybackDeviceCount()

override int agora_gaming_rtc.AudioPlaybackDeviceManager.GetAudioPlaybackDeviceCount ( )

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

Returns
Total number of the indexed audio playback devices.

◆ GetAudioPlaybackDevice()

override int agora_gaming_rtc.AudioPlaybackDeviceManager.GetAudioPlaybackDevice ( int  index,
ref string  deviceName,
ref string  deviceId 
)

Retrieves the audio playback device associated with the index.

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

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

◆ GetCurrentPlaybackDevice()

override int agora_gaming_rtc.AudioPlaybackDeviceManager.GetCurrentPlaybackDevice ( ref string  deviceId)

Retrieves the device ID of the current audio playback device.

Parameters
deviceIdThe device ID of the current audio playback device.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetAudioPlaybackDevice()

override int agora_gaming_rtc.AudioPlaybackDeviceManager.SetAudioPlaybackDevice ( string  deviceId)

Sets the audio playback device using the device ID.

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

◆ SetAudioPlaybackDeviceVolume()

override int agora_gaming_rtc.AudioPlaybackDeviceManager.SetAudioPlaybackDeviceVolume ( int  volume)

Sets the volume of the current audio playback device.

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

◆ GetAudioPlaybackDeviceVolume()

override int agora_gaming_rtc.AudioPlaybackDeviceManager.GetAudioPlaybackDeviceVolume ( )

Retrieves the volume of the current audio playback device.

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

◆ SetAudioPlaybackDeviceMute()

override int agora_gaming_rtc.AudioPlaybackDeviceManager.SetAudioPlaybackDeviceMute ( bool  mute)

Sets whether to stop audio playback.

Parameters
muteSets whether to stop audio playback.
  • true: Stops.
  • false: Doesn't stop.
Returns
  • 0: Success.
  • < 0: Failure.

◆ IsAudioPlaybackDeviceMute()

override bool agora_gaming_rtc.AudioPlaybackDeviceManager.IsAudioPlaybackDeviceMute ( )

Retrieves the status of the current audio playback device.

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

◆ StartAudioPlaybackDeviceTest()

override int agora_gaming_rtc.AudioPlaybackDeviceManager.StartAudioPlaybackDeviceTest ( string  testAudioFilePath)

Starts the test of the current audio playback device.

This method tests whether the audio playback device works properly. In the test, the SDK plays an audio file specified by the user. If the user can hear the audio, the playback device works properly.

Note
Ensure that you call StopAudioPlaybackDeviceTest after calling this method.
Parameters
testAudioFilePathThe path of the audio file for the audio playback device test in UTF-8:
  • Supported file formats: wav, mp3, m4a, and aac.
  • Supported file sample rates: 8000, 16000, 32000, 44100, and 48000 Hz.
Returns
  • 0: Success, and you can hear the sound of the specified audio file.
  • < 0: Failure.

◆ StopAudioPlaybackDeviceTest()

override int agora_gaming_rtc.AudioPlaybackDeviceManager.StopAudioPlaybackDeviceTest ( )

Stops the test of the current audio playback device.

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

◆ GetCurrentPlaybackDeviceInfo()

override int agora_gaming_rtc.AudioPlaybackDeviceManager.GetCurrentPlaybackDeviceInfo ( ref string  deviceName,
ref string  deviceId 
)

Retrieves the device information of the current audio playback device.

Parameters
deviceNameThe device name of the current audio playback device.
deviceIdThe device ID of the current audio playback device.
Returns
  • 0: Success.
  • < 0: Failure.