CloudHub Docs
Download Documents

RTS


CloudHubRTS CPP

IAudioDeviceManager

The IAudioDeviceManager interface class allows for audio device interface testing.

enumeratePlaybackDevices

Enumerates the audio playback devices. This method returns an IAudioDeviceCollection object including all audio devices in the system. With the IAudioDeviceCollection object, the application can enumerate the audio devices. The application must call the release method to release the returned object after using it.

IAudioDeviceCollection* enumeratePlaybackDevices()

Returns

enumerateRecordingDevices

Enumerates the audio capturing devices. This method returns an IAudioDeviceCollection object that includes all audio capturing devices in the system. With the IAudioDeviceCollection object, the application can enumerate the audio capturing devices.The application must call the release method to release the returned object after using it.

IAudioDeviceCollection* enumerateRecordingDevices()

Returns

setPlaybackDevice

Sets the audio playback device using the device ID.

int setPlaybackDevice(const char deviceId[MAX_DEVICE_ID_LENGTH])

Parameters

ParameterDescription
deviceIdDevice ID of the audio playback device, retrieved by calling the enumeratePlaybackDevices method

Returns

setRecordingDevice

Sets the audio capturing device using the device ID.

int setRecordingDevice(const char deviceId[MAX_DEVICE_ID_LENGTH])

Parameters

ParameterDescription
deviceIdDevice ID of the audio capturing device, retrieved by calling the enumerateRecordingDevices method

Returns

startPlaybackDeviceTest

Starts the audio playback device test.

int startPlaybackDeviceTest(const char* testAudioFilePath,bool loop=false)

Parameters

ParameterDescription
testAudioFilePathPointer to the path of the audio file for the audio playback device test
loopSets the flag of the loop

Returns

stopPlaybackDeviceTest

Stops the audio playback device test. This method stops testing the audio playback device. You must call this method to stop the test after calling the startPlaybackDeviceTest method.

int stopPlaybackDeviceTest()

Returns

setPlaybackDeviceVolume

Sets the volume of the audio playback device.

int setPlaybackDeviceVolume(int volume)

Parameters

ParameterDescription
volumeSets the volume of the audio playback device. The value ranges between 0 (lowest volume) and 255 (highest volume)

Returns

getPlaybackDeviceVolume

Gets the volume of the audio playback device.

int getPlaybackDeviceVolume(int* volume)

Parameters

ParameterDescription
volumePointer to the audio playback device volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume)

Returns

setRecordingDeviceVolume

Sets the volume of the microphone.

int setRecordingDeviceVolume(int volume)

Parameters

ParameterDescription
volumeSets the volume of the microphone. The value ranges between 0 (lowest volume) and 255 (highest volume)

Returns

getRecordingDeviceVolume

Gets the volume of the microphone.

int getRecordingDeviceVolume(int* volume)

Parameters

ParameterDescription
volumePointer to the microphone volume. The volume value ranges between 0 (lowest volume) and 255 (highest volume)

Returns

setPlaybackDeviceMute

Mutes the audio playback device.

int setPlaybackDeviceMute(bool mute)

Parameters

ParameterDescription
muteSets whether to mute/unmute the audio playback device:
• true: Mutes
• false: Unmutes

Returns

getPlaybackDeviceMute

Gets the mute status of the audio playback device.

int getPlaybackDeviceMute(bool* mute)

Parameters

ParameterDescription
mutePointer to whether the audio playback device is muted/unmuted.
• true: Muted
• false: Unmuted

Returns

setRecordingDeviceMute

Mutes/Unmutes the microphone

int setRecordingDeviceMute(bool mute)

Parameters

ParameterDescription
muteSets whether to mute/unmute the microphone:
• true: Mutes
• false: Unmutes

Returns

getRecordingDeviceMute

Gets the microphone’s mute status.

int getRecordingDeviceMute(bool* mute)

Parameters

ParameterDescription
mutePointer to whether the microphone is muted/unmuted.
• true: Muted
• false: Unmuted

Returns

startRecordingDeviceTest

Starts the audio capturing device test. This method tests whether the audio capturing device works properly.

int startRecordingDeviceTest(int indicationInterval)

Parameters

ParameterDescription
indicationIntervalWe recommend a setting greater than 200 ms. This value must not be less than 10 ms; otherwise, you can not receive the onAudioVolumeIndication callback

Returns

stopRecordingDeviceTest

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

int stopRecordingDeviceTest()

Returns

getPlaybackDevice

Gets the audio playback device associated with the device ID.

int getPlaybackDevice(char deviceId[MAX_DEVICE_ID_LENGTH])

Parameters

ParameterDescription
deviceIdPointer to the ID of the audio playback device

Returns

getPlaybackDeviceInfo

Gets the audio playback device information associated with the device ID and device name.

int getPlaybackDeviceInfo(char deviceId[MAX_DEVICE_ID_LENGTH],
                          char deviceName[MAX_DEVICE_ID_LENGTH])

Parameters

ParameterDescription
deviceIdPointer to the device ID of the audio playback device
deviceNamePointer to the device name of the audio playback device

Returns

getRecordingDevice

Gets the audio capturing device associated with the device ID.

int getRecordingDevice(char deviceId[MAX_DEVICE_ID_LENGTH])

Parameters

ParameterDescription
deviceIdPointer to the device ID of the audio capturing device

Returns

getRecordingDeviceInfo

Gets the audio capturing device information associated with the device ID and device name.

int getRecordingDeviceInfo(char deviceId[MAX_DEVICE_ID_LENGTH],
                           char deviceName[MAX_DEVICE_ID_LENGTH])

Parameters

ParameterDescription
deviceIdPointer to the device ID of the audio capturing device
deviceNamePointer to the device name of the audio capturing device

Returns

startAudioDeviceLoopbackTest

Starts the audio device loopback test. This method tests whether the local audio sampling device and playback device are working properly. After calling this method, the audio sampling device samples the local audio, and the audio playback device plays the sampled audio.

int startAudioDeviceLoopbackTest(int indicationInterval)

Parameters

ParameterDescription
indicationIntervalWe recommend a setting greater than 200 ms. This value must not be less than 10 ms; otherwise, you can not receive the onAudioVolumeIndication callback.

Returns

stopAudioDeviceLoopbackTest

Stops the audio device loopback test.

int stopAudioDeviceLoopbackTest()

Returns

release

Releases all IAudioDeviceManager resources.

void release()