Create a new RtAudio instance
Create a new RtAudio instance
api to utilize. If omitted, an available one will be picked.
Set a client-defined function that will be invoked when an error or warning occurs
the callback
A function for opening a stream with the specified parameters.
Specifies output stream parameters to use when opening a stream, including a device ID, number of channels, and starting channel number. For input-only streams, this argument should be null.
Specifies input stream parameters to use when opening a stream, including a device ID, number of channels, and starting channel number. For output-only streams, this argument should be null.
An RtAudioFormat specifying the desired sample data format.
The desired sample rate (sample frames per second).
A value indicating the desired
internal buffer size in sample frames. The actual value
used by the device is returned from openStream
call.
A value of zero can be specified, in which case the lowest
allowable value is determined.
An optional object containing various
global stream options, including a list of OR'ed RtAudioStreamFlags
and a suggested number of stream buffers that can be used to
control stream latency. More buffers typically result in more
robust performance, though at a cost of greater latency. If a
value of zero is specified, a system-specific median value is
chosen. If the RTAUDIO_MINIMIZE_LATENCY flag bit is set, the
lowest allowable value is used. The actual value used is
returned from openStream
call. The parameter is API dependent.
A function that will be invoked when input data is available and/or output data is needed.
The actual bufferFrames value used by the device.
A public function that returns a vector of audio devices.
The ID values returned by this function are used internally by RtAudio to identify a given device. The values themselves are arbitrary and do not correspond to device IDs used by the underlying API (nor are they index values). This function performs a system query of available devices each time it is called, thus supporting devices (dis)connected after instantiation. If no devices are available, the vector size will be zero. If a system error occurs during processing, a warning will be issued.
A function that returns the ID of the default input device.
If the underlying audio API does not provide a "default device", the first probed input device ID will be returned. If no devices are available, the return value will be 0 (which is an invalid device identifier).
A function that returns the ID of the default output device.
If the underlying audio API does not provide a "default device", the first probed output device ID will be returned. If no devices are available, the return value will be 0 (which is an invalid device identifier).
Returns the internal stream latency in sample frames.
The stream latency refers to delay in audio input and/or output caused by internal buffering by the audio system and/or hardware. For duplex streams, the returned value will represent the sum of the input and output latencies. If a stream is not open, the returned value will be invalid. If the API does not report latency, the return value will be zero.
Returns the number of seconds of processed data since the stream was started.
The stream time is calculated from the number of sample frames processed by the underlying audio system, which will increment by units of the audio buffer size. It is not an absolute running time. If a stream is not open, the returned value may not be valid.
Retrieve the error message corresponding to the last error or warning condition.
This function can be used to get a detailed error message when a non-zero RtAudioErrorType is returned by a function. This is the same message sent to the user-provided errorCallback function.
Static
getStatic
getA static function to determine the available compiled audio APIs.
Static
getReturn the display name of a specified compiled audio API.
This obtains a long name used for display purposes. If the API is unknown, this function will return the empty string.
the API id
Static
getReturn the name of a specified compiled audio API.
This obtains a short lower-case name used for identification purposes. This value is guaranteed to remain identical across library versions. If the API is unknown, this function will return the empty string.
the API id
Generated using TypeDoc
The RtAudio class.
If an API argument is specified but that API isn't supported, a warning is issued and an instance of an available API is created. If available API is found, the routine will abort If no API argument is specified and multiple API support has been compiled, the default order of use is ALSA, (Linux systems) and WASAPI, DS (Windows systems).