Struct cubeb_core::StreamRef
source · pub struct StreamRef(/* private fields */);
Implementations§
source§impl StreamRef
impl StreamRef
sourcepub unsafe fn from_ptr<'a>(ptr: *mut cubeb_stream) -> &'a Self
pub unsafe fn from_ptr<'a>(ptr: *mut cubeb_stream) -> &'a Self
Safety
This function is unsafe because it dereferences the given ptr
pointer.
The caller should ensure that pointer is valid.
sourcepub unsafe fn from_ptr_mut<'a>(ptr: *mut cubeb_stream) -> &'a mut Self
pub unsafe fn from_ptr_mut<'a>(ptr: *mut cubeb_stream) -> &'a mut Self
Safety
This function is unsafe because it dereferences the given ptr
pointer.
The caller should ensure that pointer is valid.
pub fn as_ptr(&self) -> *mut cubeb_stream
source§impl StreamRef
impl StreamRef
sourcepub fn latency(&self) -> Result<u32>
pub fn latency(&self) -> Result<u32>
Get the latency for this stream, in frames. This is the number of frames between the time cubeb acquires the data in the callback and the listener can hear the sound.
sourcepub fn input_latency(&self) -> Result<u32>
pub fn input_latency(&self) -> Result<u32>
Get the input latency for this stream, in frames. This is the number of frames between the time the audio input device records the audio, and the cubeb callback delivers it. This returns an error if the stream is output-only.
sourcepub fn set_volume(&self, volume: f32) -> Result<()>
pub fn set_volume(&self, volume: f32) -> Result<()>
Set the volume for a stream.
sourcepub fn current_device(&self) -> Result<&DeviceRef>
pub fn current_device(&self) -> Result<&DeviceRef>
Get the current output device for this stream.
sourcepub fn set_input_mute(&self, mute: bool) -> Result<()>
pub fn set_input_mute(&self, mute: bool) -> Result<()>
Set the mute state for an input stream.
sourcepub fn set_input_processing_params(
&self,
params: InputProcessingParams
) -> Result<()>
pub fn set_input_processing_params( &self, params: InputProcessingParams ) -> Result<()>
Set the processing parameters for an input stream.
sourcepub fn device_destroy(&self, device: DeviceRef) -> Result<()>
pub fn device_destroy(&self, device: DeviceRef) -> Result<()>
Destroy a cubeb_device structure.
sourcepub fn register_device_changed_callback(
&self,
callback: cubeb_device_changed_callback
) -> Result<()>
pub fn register_device_changed_callback( &self, callback: cubeb_device_changed_callback ) -> Result<()>
Set a callback to be notified when the output device changes.