/// Get the current stream playback position. pubfn position(&self) -> Result<u64> { letmut position = 0u64; unsafe {
call!(ffi::cubeb_stream_get_position(self.as_ptr(), &mut position))?;
}
Ok(position)
}
/// 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. pubfn latency(&self) -> Result<u32> { letmut latency = 0u32; unsafe {
call!(ffi::cubeb_stream_get_latency(self.as_ptr(), &mut latency))?;
}
Ok(latency)
}
/// 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. pubfn input_latency(&self) -> Result<u32> { letmut latency = 0u32; unsafe {
call!(ffi::cubeb_stream_get_input_latency( self.as_ptr(),
&mut latency
))?;
}
Ok(latency)
}
/// Set the volume for a stream. pubfn set_volume(&self, volume: f32) -> Result<()> { unsafe { call!(ffi::cubeb_stream_set_volume(self.as_ptr(), volume)) }
}
/// Change a stream's name pubfn set_name(&self, name: &CStr) -> Result<()> { unsafe { call!(ffi::cubeb_stream_set_name(self.as_ptr(), name.as_ptr())) }
}
/// Get the current output device for this stream. pubfn current_device(&self) -> Result<&DeviceRef> { letmut device: *mut ffi::cubeb_device = ptr::null_mut(); unsafe {
call!(ffi::cubeb_stream_get_current_device( self.as_ptr(),
&mut device
))?;
Ok(DeviceRef::from_ptr(device))
}
}
/// Set the mute state for an input stream. pubfn set_input_mute(&self, mute: bool) -> Result<()> { let mute: c_int = if mute { 1 } else { 0 }; unsafe { call!(ffi::cubeb_stream_set_input_mute(self.as_ptr(), mute)) }
}
/// Set the processing parameters for an input stream. pubfn set_input_processing_params(&self, params: InputProcessingParams) -> Result<()> { unsafe {
call!(ffi::cubeb_stream_set_input_processing_params( self.as_ptr(),
params.bits()
))
}
}
/// Set a callback to be notified when the output device changes. pubfn register_device_changed_callback(
&self,
callback: ffi::cubeb_device_changed_callback,
) -> Result<()> { unsafe {
call!(ffi::cubeb_stream_register_device_changed_callback( self.as_ptr(),
callback
))
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.