24 const RtAudio::DeviceInfo& rtInfo,
26 unsigned int defaultOutputDevice,
27 unsigned int defaultInputDevice)
30 info.
name = rtInfo.name;
90 unsigned int output_device_id,
91 unsigned int input_device_id,
93 void* user_data)
override;
223 unsigned int output_device_id,
224 unsigned int input_device_id,
241 void open()
override;
249 void start()
override;
257 void stop()
override;
265 void close()
override;
287 std::function<
int(
void*,
void*,
unsigned int)> processCallback)
override;
307 unsigned int num_frames,
309 RtAudioStreamStatus status,
Manages audio endpoint discovery and enumeration.
Manages digital audio data flow between the engine and hardware.
Interface for audio system abstraction layer.
int get_api_type() const override
Retrieves the RtAudio API type identifier.
RtAudio & get_context_reference()
Provides safe access to the RtAudio context.
std::string get_version_string() const override
Retrieves the RtAudio library version.
std::unique_ptr< AudioStream > create_stream(unsigned int output_device_id, unsigned int input_device_id, const GlobalStreamInfo &stream_info, void *user_data) override
Creates an RtAudio-specific audio stream.
RtAudio * m_context
Pointer to the underlying RtAudio context.
void cleanup() override
Releases all resources held by the backend.
RtAudioBackend()
Initializes the RtAudio backend.
std::unique_ptr< AudioDevice > create_device_manager() override
Creates an RtAudio-specific device manager.
~RtAudioBackend() override
Cleans up the RtAudio backend.
RtAudio implementation of the audio backend interface.
std::vector< DeviceInfo > m_output_devices
Cached list of output devices.
unsigned int m_defaultOutputDevice
System identifier for the default output device.
RtAudio * m_context
Pointer to the underlying RtAudio context.
std::vector< DeviceInfo > get_input_devices() const override
Retrieves information about all available input devices.
std::vector< DeviceInfo > m_input_devices
Cached list of input devices.
std::vector< DeviceInfo > get_output_devices() const override
Retrieves information about all available output devices.
unsigned int get_default_output_device() const override
Gets the system's primary output device identifier.
unsigned int get_default_input_device() const override
Gets the system's primary input device identifier.
unsigned int m_defaultInputDevice
System identifier for the default input device.
RtAudio implementation of the audio device interface.
RtAudio::StreamOptions m_options
RtAudio-specific stream options.
GlobalStreamInfo m_stream_info
Copy of the stream configuration for reference.
void set_process_callback(std::function< int(void *, void *, unsigned int)> processCallback) override
Sets the function to process audio data.
void * m_userData
User-provided context pointer for callbacks.
void start() override
Activates the audio stream and begins data transfer.
void stop() override
Deactivates the audio stream and halts data transfer.
void configure_stream_options()
Configures RtAudio stream options based on GlobalStreamInfo.
~RtAudioStream() override
Ensures proper cleanup of stream resources.
bool m_isOpen
Flag indicating if the stream is currently open.
bool is_open() const override
Checks if the stream is initialized and ready for activation.
void open() override
Initializes the audio stream and allocates required resources.
bool m_isRunning
Flag indicating if the stream is currently running.
GlobalStreamInfo stream_info
Engine stream configuration.
RtAudio::StreamParameters m_in_parameters
RtAudio-specific stream input configuration parameters.
RtAudio::StreamParameters m_out_parameters
RtAudio-specific stream output configuration parameters.
void close() override
Terminates the audio stream and releases all resources.
RtAudio * m_context
Pointer to the underlying RtAudio context.
std::function< int(void *, void *, unsigned int)> m_process_callback
User-provided callback function for audio processing.
static int rtAudioCallback(void *output_buffer, void *input_buffer, unsigned int num_frames, double stream_time, RtAudioStreamStatus status, void *user_data)
Static callback function for the RtAudio API.
bool is_running() const override
Checks if the stream is actively processing audio data.
RtAudio implementation of the audio stream interface.
static DeviceInfo convert_device_info(const RtAudio::DeviceInfo &rtInfo, unsigned int id, unsigned int defaultOutputDevice, unsigned int defaultInputDevice)
Converts RtAudio-specific device information to the engine's device model.
std::string name
System identifier for the audio endpoint.
uint32_t duplex_channels
Number of channels supporting simultaneous input and output.
std::vector< uint32_t > supported_samplerates
Collection of all sample rates supported by this device.
bool is_default_output
Indicates if this device is the system's primary output endpoint.
uint32_t input_channels
Number of discrete input channels available for signal capture.
bool is_default_input
Indicates if this device is the system's primary input endpoint.
uint32_t output_channels
Number of discrete output channels available for signal playback.
uint32_t preferred_sample_rate
Optimal sample rate for this device as reported by the system.
Contains digital audio device configuration parameters.
Comprehensive configuration for digital audio stream processing.