pub struct StreamConfig {
pub output_device: Option<DeviceParams>,
pub input_device: Option<DeviceParams>,
pub sample_format: SampleFormat,
pub sample_rate: Option<u32>,
pub buffer_frames: u32,
pub flags: StreamFlags,
pub num_buffers: u32,
pub priority: i32,
pub name: String,
}Expand description
The configuration of an audio stream.
Fields§
§output_device: Option<DeviceParams>The parameters for the output device to use. If you do
not wish to use an output device, set this to None.
The default value is Some(Default::default()).
input_device: Option<DeviceParams>The parameters for the input device to use. If you do not
wish to use an input device, set this to None.
The default value is None.
sample_format: SampleFormatThe sample format to use. If the device doesn’t natively support the given format, then it will automatically be converted to/from that format.
The default value is SampleFormat::Float32.
sample_rate: Option<u32>The sample rate to use. The stream may decide to use a
different sample rate if it’s not supported. Set to None to use the
output device’s default sample rate.
The default value is None.
buffer_frames: u32The desired maximum number of frames that can appear in a single process call. The stream may decide to use a different value if it’s not supported. A value of zero can be specified, in which case the lowest allowable value is determined.
The default value is 1024.
flags: StreamFlagsThe bit flag parameters for this stream.
By default, no flags are set.
num_buffers: u32Used to control stream latency in the Windows DirectSound, Linux OSS, and Linux Alsa APIs only. A value of two is usually the smallest allowed. Larger numbers can potentially result in more robust stream performance, though likely at the cost of stream latency.
The actual value used when the stream is ran may be different.
The default value is 4.
priority: i32Scheduling priority of callback thread (only used with flag StreamFlags::SCHEDULE_REALTIME).
Use a value of -1 for the default priority.
The default value is -1.
name: StringThe name of the stream (currently used only in Jack).
The size of the name cannot exceed 511 bytes.
Implementations§
Source§impl StreamConfig
impl StreamConfig
pub fn raw_stream_options( &self, ) -> Result<rtaudio_stream_options_t, RtAudioError>
Trait Implementations§
Source§impl Clone for StreamConfig
impl Clone for StreamConfig
Source§fn clone(&self) -> StreamConfig
fn clone(&self) -> StreamConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more