Initializes the audio stream and allocates required resources.
Opens the RtAudio stream with the configured parameters, making it ready for data transfer. Does not start the actual data flow.
211{
213 return;
214 }
215
216 try {
217 RtAudioFormat
format = RTAUDIO_FLOAT64;
218
222 break;
225 break;
228 break;
231 break;
234 break;
235 }
236
237 RtAudio::StreamParameters* inputParamsPtr = nullptr;
238
240
242
244 }
245
247
250 inputParamsPtr,
251 format,
255 this,
257
259 } catch (const RtAudioErrorType& e) {
262
266 std::source_location::current(),
267 "Failed to open RtAudio stream: {}",
269 }
270}
static void mark_stream_closed()
Deregisters an active audio stream from the system.
static void mark_stream_open()
Registers an active audio stream in the system.
RtAudio::StreamOptions m_options
RtAudio-specific stream options.
GlobalStreamInfo m_stream_info
Copy of the stream configuration for reference.
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.
RtAudio::StreamParameters m_in_parameters
RtAudio-specific stream input configuration parameters.
RtAudio::StreamParameters m_out_parameters
RtAudio-specific stream output configuration parameters.
RtAudio * m_context
Pointer to the underlying RtAudio context.
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.
@ AudioBackend
Audio processing backend (RtAudio, JACK, ASIO)
void error_rethrow(Component component, Context context, std::source_location location=std::source_location::current(), std::string_view additional_context="")
Catch and log an exception, then rethrow it.
std::string format(format_string< std::remove_cvref_t< Args >... > fmt_str, Args &&... args)
@ Core
Core engine, backend, subsystems.
uint32_t channels
Number of discrete channels in this set.
bool enabled
Whether this channel set is active in the stream.
uint32_t buffer_size
Number of samples per processing block.
ChannelConfig input
Configuration for input signal channels (disabled by default)
uint32_t sample_rate
Number of samples processed per second (Hz)
@ FLOAT64
64-bit floating point representation (-1.0 to 1.0)
@ INT16
16-bit integer representation (-32768 to 32767)
@ INT32
32-bit integer representation (-2147483648 to 2147483647)
@ INT24
24-bit integer representation (-8388608 to 8388607)
@ FLOAT32
32-bit floating point representation (-1.0 to 1.0)
AudioFormat format
Sample data format for stream processing.