pub struct VolumeDb(pub i16);Expand description
Volume in 8.8 fixed-point dB format (USB Audio spec)
The USB Audio Class represents volume as a signed 16-bit value in 1/256 dB steps. The integer part is the upper 8 bits (signed), the fractional part is the lower 8 bits.
Examples:
- 0x0000 = 0.0 dB (unity gain)
- 0x0100 = +1.0 dB
- 0xFF00 = -1.0 dB (two’s complement)
- 0x8000 = -128.0 dB (silence)
- 0x7FFF = +127.99609375 dB (max)
Tuple Fields§
§0: i16Trait Implementations§
Source§impl Ord for VolumeDb
impl Ord for VolumeDb
Source§impl PartialOrd for VolumeDb
impl PartialOrd for VolumeDb
impl Copy for VolumeDb
impl Eq for VolumeDb
impl StructuralPartialEq for VolumeDb
Auto Trait Implementations§
impl Freeze for VolumeDb
impl RefUnwindSafe for VolumeDb
impl Send for VolumeDb
impl Sync for VolumeDb
impl Unpin for VolumeDb
impl UnwindSafe for VolumeDb
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)