|
LiveKit C++ Client SDK v1.1.0
Real-time audio/video/data SDK for C++
|
Platform audio device manager backed by WebRTC's Audio Device Module. More...
#include <platform_audio.h>
Public Member Functions | |
| PlatformAudio () | |
| Create a platform audio manager. | |
| PlatformAudio (const PlatformAudio &other)=default | |
| Copy the platform audio manager. | |
| PlatformAudio & | operator= (const PlatformAudio &other)=default |
| Copy-assign the platform audio manager. | |
| PlatformAudio (PlatformAudio &&other) noexcept=default | |
| Move the platform audio manager. | |
| PlatformAudio & | operator= (PlatformAudio &&other) noexcept=default |
| Move-assign the platform audio manager. | |
| std::int32_t | recordingDeviceCount () const |
| Return the current number of recording devices. | |
| std::int32_t | playoutDeviceCount () const |
| Return the current number of playout devices. | |
| std::vector< AudioDeviceInfo > | recordingDevices () const |
| Enumerate available microphones. | |
| std::vector< AudioDeviceInfo > | playoutDevices () const |
| Enumerate available speakers/headphones. | |
| void | setRecordingDevice (const std::string &device_id) const |
| Select the microphone by device ID. | |
| void | setPlayoutDevice (const std::string &device_id) const |
| Select the speaker/headphones by device ID. | |
| std::shared_ptr< PlatformAudioSource > | createAudioSource (const PlatformAudioOptions &options={}) const |
| Create an automatically captured microphone source for LocalAudioTrack. | |
Platform audio device manager backed by WebRTC's Audio Device Module.
Use PlatformAudio for microphone capture when built-in echo cancellation, noise suppression, automatic gain control, and speaker playout are desired. Use AudioSource instead when the application needs direct access to raw PCM frames or custom audio generation.
| livekit::PlatformAudio::PlatformAudio | ( | ) |
Create a platform audio manager.
Enables WebRTC's platform Audio Device Module for microphone capture and speaker playout.
| PlatformAudioError | If the FFI response is malformed or the platform Audio Device Module cannot be created. |
|
default |
Copy the platform audio manager.
The copy shares the same underlying platform audio handle.
| other | Manager to copy from. |
|
defaultnoexcept |
Move the platform audio manager.
| other | Manager to move from. |
| std::shared_ptr< PlatformAudioSource > livekit::PlatformAudio::createAudioSource | ( | const PlatformAudioOptions & | options = {} | ) | const |
Create an automatically captured microphone source for LocalAudioTrack.
Each call returns a new track source handle backed by the shared platform Audio Device Module; it does not create a separate ADM instance.
| options | Audio processing options for the platform microphone path. |
| PlatformAudioError | If the FFI response is malformed or source creation fails. |
|
default |
Copy-assign the platform audio manager.
The assigned instance shares the same underlying platform audio handle.
| other | Manager to copy from. |
|
defaultnoexcept |
Move-assign the platform audio manager.
| other | Manager to move from. |
| std::int32_t livekit::PlatformAudio::playoutDeviceCount | ( | ) | const |
Return the current number of playout devices.
| PlatformAudioError | If the FFI response is malformed or device enumeration fails. |
| std::vector< AudioDeviceInfo > livekit::PlatformAudio::playoutDevices | ( | ) | const |
Enumerate available speakers/headphones.
| PlatformAudioError | If the FFI response is malformed or device enumeration fails. |
| std::int32_t livekit::PlatformAudio::recordingDeviceCount | ( | ) | const |
Return the current number of recording devices.
| PlatformAudioError | If the FFI response is malformed or device enumeration fails. |
| std::vector< AudioDeviceInfo > livekit::PlatformAudio::recordingDevices | ( | ) | const |
Enumerate available microphones.
| PlatformAudioError | If the FFI response is malformed or device enumeration fails. |
| void livekit::PlatformAudio::setPlayoutDevice | ( | const std::string & | device_id | ) | const |
Select the speaker/headphones by device ID.
| device_id | Stable device identifier from AudioDeviceInfo::id. |
| PlatformAudioError | If the FFI response is malformed or device selection fails. |
| void livekit::PlatformAudio::setRecordingDevice | ( | const std::string & | device_id | ) | const |
Select the microphone by device ID.
| device_id | Stable device identifier from AudioDeviceInfo::id. |
| PlatformAudioError | If the FFI response is malformed or device selection fails. |