NERtc Windows SDK
Public Member Functions | List of all members
nertc::IAudioDeviceManager Class Referenceabstract

#include <nertc_audio_device_manager.h>

Public Member Functions

virtual IDeviceCollectionenumerateRecordDevices ()=0
 
virtual int setRecordDevice (const char device_id[kNERtcMaxDeviceIDLength])=0
 
virtual int getRecordDevice (char device_id[kNERtcMaxDeviceIDLength])=0
 
virtual IDeviceCollectionenumeratePlayoutDevices ()=0
 
virtual int setPlayoutDevice (const char device_id[kNERtcMaxDeviceIDLength])=0
 
virtual int getPlayoutDevice (char device_id[kNERtcMaxDeviceIDLength])=0
 
virtual int setRecordDeviceVolume (uint32_t volume)=0
 
virtual int getRecordDeviceVolume (uint32_t *volume)=0
 
virtual int setPlayoutDeviceVolume (uint32_t volume)=0
 
virtual int getPlayoutDeviceVolume (uint32_t *volume)=0
 
virtual int setPlayoutDeviceMute (bool mute)=0
 
virtual int getPlayoutDeviceMute (bool *mute)=0
 
virtual int setRecordDeviceMute (bool mute)=0
 
virtual int getRecordDeviceMute (bool *mute)=0
 
virtual int adjustRecordingSignalVolume (uint32_t volume)=0
 
virtual int adjustPlaybackSignalVolume (uint32_t volume)=0
 
virtual int startRecordDeviceTest (uint64_t indication_interval)=0
 
virtual int stopRecordDeviceTest ()=0
 
virtual int startPlayoutDeviceTest (const char *test_audio_file_path)=0
 
virtual int stopPlayoutDeviceTest ()=0
 
virtual int startAudioDeviceLoopbackTest (uint64_t indication_interval)=0
 
virtual int stopAudioDeviceLoopbackTest ()=0
 

Detailed Description

音频设备管理方法。

IAudioDeviceManager 接口类提供用于管理音频设备的相关接口。可通过实例化 IAudioDeviceManager 类来获取 IAudioDeviceManager 接口。

Member Function Documentation

virtual int nertc::IAudioDeviceManager::adjustPlaybackSignalVolume ( uint32_t  volume)
pure virtual

调节播放音量。

Parameters
[in]volume播放音量可在 0 ~ 400 范围内进行调节:
  • 0: 静音;
  • 100: 原始音量;
  • 400: 最大可为原始音量的 4 倍(自带溢出保护)。
Returns
  • 0: 方法调用成功;
  • 其他: 方法调用失败。
virtual int nertc::IAudioDeviceManager::adjustRecordingSignalVolume ( uint32_t  volume)
pure virtual

调节录音音量。

Parameters
[in]volume录音信号音量可在 0 ~ 400 范围内进行调节:
  • 0: 静音;
  • 100: 原始音量;
  • 400: 最大可为原始音量的 4 倍(自带溢出保护)。
Returns
  • 0: 方法调用成功;
  • 其他: 方法调用失败。
virtual IDeviceCollection* nertc::IAudioDeviceManager::enumeratePlayoutDevices ( )
pure virtual

Enumerates the audio playout devices.

This method returns an IDeviceCollection object that includes all audio playout devices in the system. With the IDeviceCollection object, the application can enumerate the audio playout devices.

Note
The application must call the destroy method to destroy the returned object after using it.
Returns
  • Returns an IDeviceCollection object that includes all audio playout devices in the system: Success.
  • Returns NULL: Failure.
virtual IDeviceCollection* nertc::IAudioDeviceManager::enumerateRecordDevices ( )
pure virtual

Enumerates the audio recording devices.

This method returns an IDeviceCollection object that includes all audio recording devices in the system. With the IDeviceCollection object, the application can enumerate the audio recording devices.

Note
The application needs to call the destroy method to destroy the returned object after using it.
Returns
  • Returns an IDeviceCollection object that includes all audio recording devices in the system: Success.
  • Returns NULL: Failure.
virtual int nertc::IAudioDeviceManager::getPlayoutDevice ( char  device_id[kNERtcMaxDeviceIDLength])
pure virtual

Retrieves the audio playout device associated with the device ID.

Parameters
device_idPointer to the ID of the audio playout device.plus:kNERtcAudioDeviceAutoID
Returns
  • 0: Success.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::getPlayoutDeviceMute ( bool *  mute)
pure virtual

Retrieves the mute state of the playout device.

Parameters
muteWhether the playout device is muted/unmuted.
  • true: The playout device is muted.
  • false: The playout device is unmuted.
Returns
  • 0: Success.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::getPlayoutDeviceVolume ( uint32_t *  volume)
pure virtual

Retrieves the volume of the audio playout device.

Parameters
volumePointer to the audio playout device volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume).
Returns
  • 0: Success.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::getRecordDevice ( char  device_id[kNERtcMaxDeviceIDLength])
pure virtual

Retrieves the audio recording device associated with the device ID.

Parameters
device_idPointer to the device ID of the audio recording device.
Returns
  • 0: Success.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::getRecordDeviceMute ( bool *  mute)
pure virtual

Retrieves the microphone’s mute status.

Parameters
muteWhether the microphone is muted/unmuted.
  • true: The microphone is muted.
  • false: The microphone is unmuted.
Returns
  • 0: Success.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::getRecordDeviceVolume ( uint32_t *  volume)
pure virtual

Retrieves the volume of the microphone.

Parameters
volumePointer to the microphone volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume).
Returns
  • 0: Success.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::setPlayoutDevice ( const char  device_id[kNERtcMaxDeviceIDLength])
pure virtual

Sets the audio playout device using the device ID.

Note
Plugging or unplugging the audio device does not change the device ID.plus:kNERtcAudioDeviceAutoID
Parameters
device_idDevice ID of the audio playout device, retrieved by calling the enumeratePlayoutDevices method.
Returns
  • 0: Success.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::setPlayoutDeviceMute ( bool  mute)
pure virtual

Mutes the audio playout device.

Parameters
mute
  • true: Mutes the device.
  • false: Unmutes the device.
Returns
  • 0: Success.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::setPlayoutDeviceVolume ( uint32_t  volume)
pure virtual

Sets the volume of the audio playout device.

Parameters
volumeSets the volume of the audio playout device. The value ranges between 0 (lowest volume) and 255 (highest volume).
Returns
  • 0: Success.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::setRecordDevice ( const char  device_id[kNERtcMaxDeviceIDLength])
pure virtual

Sets the audio recording device using the device ID.

Parameters
device_idDevice ID of the audio recording device, retrieved by calling the enumerateRecordDevices method.
Note
Plugging or unplugging the audio device does not change the device ID.
Returns
  • 0: Success.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::setRecordDeviceMute ( bool  mute)
pure virtual

Mutes/Unmutes the microphone.

Parameters
muteWhether to mute/unmute the microphone.
  • true: Mutes the microphone.
  • false: Unmutes the microphone.
Returns
  • 0: Success.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::setRecordDeviceVolume ( uint32_t  volume)
pure virtual

Sets the volume of the microphone.

Parameters
volumeSets the volume of the microphone. The value ranges between 0 (lowest volume) and 255 (highest volume).
Returns
  • 0: Success.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::startAudioDeviceLoopbackTest ( uint64_t  indication_interval)
pure virtual

Starts the audio device loopback test.

This method tests whether the audio device loopback works properly. Once the test starts, the SDK uses the onLocalAudioVolumeIndication callback function to notify the application with the volume information.

Parameters
indication_intervalInterval period (ms) of the onLocalAudioVolumeIndication callback function cycle.
Returns
  • 0: Success.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::startPlayoutDeviceTest ( const char *  test_audio_file_path)
pure virtual

Starts the audio playout device test.

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

Parameters
test_audio_file_pathFile path of the audio file for the test, which is in the UTF-8 absolute path:
  • Supported file format: wav, mp3, and aac
Returns
  • 0: Success and you can hear the sound of the file you set.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::startRecordDeviceTest ( uint64_t  indication_interval)
pure virtual

Starts the microphone test.

This method tests whether the microphone works properly. Once the test starts, the SDK uses the onLocalAudioVolumeIndication callback function to notify the application with the volume information.

Parameters
indication_intervalInterval period (ms) of the onLocalAudioVolumeIndication callback function cycle.
Returns
  • 0: Success.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::stopAudioDeviceLoopbackTest ( )
pure virtual

Stops the audio device loopback test.

Returns
  • 0: Success.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::stopPlayoutDeviceTest ( )
pure virtual

Stops the audio playout device test.

Returns
  • 0: Success.
  • other: Failure.
virtual int nertc::IAudioDeviceManager::stopRecordDeviceTest ( )
pure virtual

Stops the microphone test.

This method stops the microphone test. To stop the test, call this method after calling the IAudioDeviceManager::startRecordDeviceTest method.

Returns
  • 0: Success.
  • other: Failure.

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