#[repr(i32)]pub enum AudioSampleRate {
Rate8000 = 8_000,
Rate16000 = 16_000,
Rate24000 = 24_000,
Rate48000 = 48_000,
}Expand description
Audio sample rate for capture
ScreenCaptureKit supports a fixed set of sample rates. Using values outside
this set will result in the system defaulting to 48000 Hz.
§Examples
use screencapturekit::stream::configuration::audio::AudioSampleRate;
// Get the Hz value
assert_eq!(AudioSampleRate::Rate48000.as_hz(), 48000);
// Use default (48000 Hz)
let rate = AudioSampleRate::default();
assert_eq!(rate, AudioSampleRate::Rate48000);Variants§
Rate8000 = 8_000
8000 Hz - Low quality, suitable for telephony
Rate16000 = 16_000
16000 Hz - Speech quality
Rate24000 = 24_000
24000 Hz - Medium quality
Rate48000 = 48_000
48000 Hz - Professional audio quality (default)
Implementations§
Source§impl AudioSampleRate
impl AudioSampleRate
Sourcepub const fn from_hz(hz: i32) -> Option<Self>
pub const fn from_hz(hz: i32) -> Option<Self>
Create from Hz value, returning None if unsupported
§Examples
use screencapturekit::stream::configuration::audio::AudioSampleRate;
assert_eq!(AudioSampleRate::from_hz(48000), Some(AudioSampleRate::Rate48000));
assert_eq!(AudioSampleRate::from_hz(44100), None); // Not supportedTrait Implementations§
Source§impl Clone for AudioSampleRate
impl Clone for AudioSampleRate
Source§fn clone(&self) -> AudioSampleRate
fn clone(&self) -> AudioSampleRate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AudioSampleRate
impl Debug for AudioSampleRate
Source§impl Default for AudioSampleRate
impl Default for AudioSampleRate
Source§fn default() -> AudioSampleRate
fn default() -> AudioSampleRate
Returns the “default value” for a type. Read more
Source§impl Display for AudioSampleRate
impl Display for AudioSampleRate
Source§impl From<AudioSampleRate> for i32
impl From<AudioSampleRate> for i32
Source§fn from(rate: AudioSampleRate) -> Self
fn from(rate: AudioSampleRate) -> Self
Converts to this type from the input type.
Source§impl Hash for AudioSampleRate
impl Hash for AudioSampleRate
Source§impl PartialEq for AudioSampleRate
impl PartialEq for AudioSampleRate
impl Copy for AudioSampleRate
impl Eq for AudioSampleRate
impl StructuralPartialEq for AudioSampleRate
Auto Trait Implementations§
impl Freeze for AudioSampleRate
impl RefUnwindSafe for AudioSampleRate
impl Send for AudioSampleRate
impl Sync for AudioSampleRate
impl Unpin for AudioSampleRate
impl UnwindSafe for AudioSampleRate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more