NERtc Unity SDK  V4.5.907
Public Member Functions | List of all members
nertc.IAudioDeviceManager Class Referenceabstract
Inheritance diagram for nertc.IAudioDeviceManager:

Public Member Functions

abstract IDeviceCollection EnumerateRecordDevices ()
 
abstract int SetRecordDevice (string deviceId)
 
abstract int GetRecordDevice (out string deviceId)
 
abstract IDeviceCollection EnumeratePlayoutDevices ()
 
abstract int SetPlayoutDevice (string deviceId)
 
abstract int GetPlayoutDevice (out string deviceId)
 
abstract int SetRecordDeviceVolume (uint volume)
 
abstract int GetRecordDeviceVolume (ref uint volume)
 
abstract int SetPlayoutDeviceVolume (uint volume)
 
abstract int GetPlayoutDeviceVolume (ref uint volume)
 
abstract int SetPlayoutDeviceMute (bool mute)
 
abstract int GetPlayoutDeviceMute (ref bool mute)
 
abstract int SetRecordDeviceMute (bool mute)
 
abstract int GetRecordDeviceMute (ref bool mute)
 
abstract int StartRecordDeviceTest (ulong indicationInterval)
 
abstract int StopRecordDeviceTest ()
 
abstract int StartPlayoutDeviceTest (string testAudioFilePath)
 
abstract int StopPlayoutDeviceTest ()
 
abstract int StartAudioDeviceLoopbackTest (ulong indicationInterval)
 
abstract int StopAudioDeviceLoopbackTest ()
 

Detailed Description

Audio device management method.
The interface class provides related interfaces for audio device management. Gets IAudioDeviceManager interface by the IRtcEngine class. The interface class is supported on Windows and macOS only and unavailable for Android and iOS

Member Function Documentation

◆ EnumerateRecordDevices()

abstract IDeviceCollection nertc.IAudioDeviceManager.EnumerateRecordDevices ( )
pure virtual

Gets the list of all the audio capture devices in the system.
The method returns an IDeviceCollection object that includes all the audio capture devices in the system. Enumerates capturing devices with the App through the IDeviceCollection object.

Note
After the method is used, the App needs to destroy the returned object by calling Destroy method.
Returns
  • Success: IDeviceCollection object including all audio capture devices.
  • Failure: Null.

◆ SetRecordDevice()

abstract int nertc.IAudioDeviceManager.SetRecordDevice ( string  deviceId)
pure virtual

Specifies the audio capture device.

Parameters
deviceIdThe device ID of the audio capture devices. Gets the ID through EnumerateRecordDevices. Device swapping or plugging does not affect deviceId.
Returns
  • 0: Success.
  • Other values: Failure.

◆ GetRecordDevice()

abstract int nertc.IAudioDeviceManager.GetRecordDevice ( out string  deviceId)
pure virtual

Gets the ID of the audio capture device that is currently used.

Parameters
deviceIdThe device ID of the audio capture devices.
Returns
  • 0: Success.
  • Other values: Failure.

◆ EnumeratePlayoutDevices()

abstract IDeviceCollection nertc.IAudioDeviceManager.EnumeratePlayoutDevices ( )
pure virtual

Gets the list of all playback devices in the system.
The method returns an IDeviceCollection object that includes all audio playback devices in the system. Enumerates playback devices with the App through the IDeviceCollection object. After the method is used, the App needs to destroy the returned object by calling the Destroy method.

Note
The system must destroy the returned value by calling Destroy method.
Returns
  • Success: Gets an IDeviceCollection object that includes all audio playback devices.
  • Failure: Null.

◆ SetPlayoutDevice()

abstract int nertc.IAudioDeviceManager.SetPlayoutDevice ( string  deviceId)
pure virtual

Specifies the audio playback device.

Parameters
deviceIdThe device ID of audio playback devices. Gets the ID through EnumeratePlayoutDevices. Device swapping or plugging does not affect deviceId.
Returns
  • 0: Success.
  • Other values: Failure.

◆ GetPlayoutDevice()

abstract int nertc.IAudioDeviceManager.GetPlayoutDevice ( out string  deviceId)
pure virtual

Gets the ID of the audio playback device that is currently used.

Parameters
deviceIdThe ID of audio playback devices.
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetRecordDeviceVolume()

abstract int nertc.IAudioDeviceManager.SetRecordDeviceVolume ( uint  volume)
pure virtual

Sets the volume of the audio capture device.

Parameters
volumeThe volume of the audio capture device. Valid values: 0 to 255.
Returns
  • 0: Success.
  • Other values: Failure.

◆ GetRecordDeviceVolume()

abstract int nertc.IAudioDeviceManager.GetRecordDeviceVolume ( ref uint  volume)
pure virtual

Gets the volume of the audio capture device.

Parameters
volumeThe volume of the audio capture device.
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetPlayoutDeviceVolume()

abstract int nertc.IAudioDeviceManager.SetPlayoutDeviceVolume ( uint  volume)
pure virtual

Sets the volume of audio playback device.

Parameters
volumeThe volume of audio playback device. Valid values: 0 to 255.
Returns
  • 0: Success.
  • Other values: Failure.

◆ GetPlayoutDeviceVolume()

abstract int nertc.IAudioDeviceManager.GetPlayoutDeviceVolume ( ref uint  volume)
pure virtual

Gets the volume of audio playback device.

Parameters
volumeThe volume of audio playback device.
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetPlayoutDeviceMute()

abstract int nertc.IAudioDeviceManager.SetPlayoutDeviceMute ( bool  mute)
pure virtual

Specifies to mute or unmute the audio playback device.

Parameters
muteindicates whether to unmute the audio playback device.
  • true: Specifies to mute the audio playback device.
  • false: Specifies to unmute the audio playback device.
Returns
  • 0: Success.
  • Other values: Failure.

◆ GetPlayoutDeviceMute()

abstract int nertc.IAudioDeviceManager.GetPlayoutDeviceMute ( ref bool  mute)
pure virtual

Confirms whether the audio playback device is muted.

Parameters
muteindicates the audio playback device is muted.
  • true: The device is muted.
  • false: The device is unmuted.
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetRecordDeviceMute()

abstract int nertc.IAudioDeviceManager.SetRecordDeviceMute ( bool  mute)
pure virtual

Specifies to mute or unmute the audio playback device.

Parameters
muteindicates whether to unmute the audio playback device.
  • true: Specifies to mute the audio playback device.
  • false: Specifies to unmute the audio playback device.
Returns
  • 0: Success.
  • Other values: Failure.

◆ GetRecordDeviceMute()

abstract int nertc.IAudioDeviceManager.GetRecordDeviceMute ( ref bool  mute)
pure virtual

Confirms whether the audio playback device is muted.

Parameters
muteindicates the audio playback device is muted.
  • true: The device is muted.
  • false: The device is unmuted.
Returns
  • 0: Success.
  • Other values: Failure.

◆ StartRecordDeviceTest()

abstract int nertc.IAudioDeviceManager.StartRecordDeviceTest ( ulong  indicationInterval)
pure virtual

Starts the test of the audio capture device.
The method tests whether the audio capture device can work properly.
After calling the method, the SDK triggers OnLocalAudioVolumeIndication callback at the time interval set in this method, which reports the volume information of the capturing device.

Note
  • Calls the method before a user needs to join a room.
  • The test of the audio capture device can automatically stop after a call starts. You can also manually stop the test by calling StopRecordDeviceTest .
Parameters
indicationIntervalindicates the time interval that SDK returns OnLocalAudioVolumeIndication callback. Unit: milliseconds.
Returns
  • 0: Success.
  • Other values: Failure.

◆ StopRecordDeviceTest()

abstract int nertc.IAudioDeviceManager.StopRecordDeviceTest ( )
pure virtual

Stops the test of the audio capture device.
Uses the method to stop the test of the audio capture device.

Note
  • Calls the method before a user needs to join a room.
  • The test of the audio capture device can automatically stop after a call starts. You can also manually stop the test by calling StopRecordDeviceTest.
Returns
  • 0: Success.
  • Other values: Failure.

◆ StartPlayoutDeviceTest()

abstract int nertc.IAudioDeviceManager.StartPlayoutDeviceTest ( string  testAudioFilePath)
pure virtual

Starts the test of the audio capture device. The method tests whether the audio capture device can work properly. After the test is started, SDK plays the specified audio files. If the sound is successfully played, the playback device can work properly. After calling the method, the SDK triggers OnLocalAudioVolumeIndication callback per 100 ms, which reports the volume information of the playback device.

Note
  • Calls the method before a user needs to join a room.
  • The test of the audio playback device can automatically stop after a call starts. You can also manually stop the test by calling StopPlayoutDeviceTest.
  • Supported file formats: wav, mp3, aac.
Parameters
testAudioFilePathThe absolute path of audio files. The path string is encoded in UTF-8.
Returns
  • 0: Success. You can hear the audio of the set files.
  • Other values: Failure.

◆ StopPlayoutDeviceTest()

abstract int nertc.IAudioDeviceManager.StopPlayoutDeviceTest ( )
pure virtual

Stops the test of the audio capture device.

Note
  • Calls the method before a user needs to join a room.
  • The test of the audio playback device can automatically stop after a call starts. You can also manually stop the test by calling StopPlayoutDeviceTest.
Returns
  • 0: Success.
  • Other values: Failure.

◆ StartAudioDeviceLoopbackTest()

abstract int nertc.IAudioDeviceManager.StartAudioDeviceLoopbackTest ( ulong  indicationInterval)
pure virtual

Starts the test of the audio device circuit.
The method tests whether the audio capturing and playback device can work properly. Once the test starts, the audio capture device captures local audio, and then plays the local audio. The SDK triggers onLocalAudioVolumeIndication
callback at the time interval set in this method, which reports the volume information of the audio.

Note
  • Calls the method before a user needs to join a room.
  • The test of the audio device circuit can automatically stop after a call starts. You can also manually stop the test by calling StopAudioDeviceLoopbackTest .
  • You can use the method locally to test the audio device, which does not require an Internet connection.
Parameters
indicationIntervalThe time interval that SDK returns onLocalAudioVolumeIndication
callback. Unit: milliseconds.
Returns
  • 0: Success.
  • Other values: Failure.

◆ StopAudioDeviceLoopbackTest()

abstract int nertc.IAudioDeviceManager.StopAudioDeviceLoopbackTest ( )
pure virtual

Stops the test of the audio device circuit.

Note
  • Calls the method before a user needs to join a room.
  • The test of the audio device circuit can automatically stop after a call starts. You can also manually stop the test by calling StopAudioDeviceLoopbackTest.
Returns
  • 0: Success.
  • Other values: Failure.

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