pub struct Spectrum(pub Vec<u8>);Expand description
A frequency spectrum of the audio currently being played.
Each byte is one bin’s magnitude in decibels, scaled linearly from SPECTRUM_MIN_DB
to SPECTRUM_MAX_DB onto 0..=255 and clamped - the same contract as Web Audio’s
getByteFrequencyData, so a client can run the site’s own mapping arithmetic unchanged.
Bins run from lowest frequency to highest.
Carried base64-encoded rather than as an array of 1024 numbers: roughly 1.4 KB per snapshot instead of 4 KB, and the snapshot stays readable.
Tuple Fields§
§0: Vec<u8>Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Spectrum
impl<'de> Deserialize<'de> for Spectrum
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Spectrum
impl StructuralPartialEq for Spectrum
Auto Trait Implementations§
impl Freeze for Spectrum
impl RefUnwindSafe for Spectrum
impl Send for Spectrum
impl Sync for Spectrum
impl Unpin for Spectrum
impl UnsafeUnpin for Spectrum
impl UnwindSafe for Spectrum
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.