Struct AudioAttributes

Source
pub struct AudioAttributes {
    pub src: Option<Uri>,
    pub fetch_timeout: Option<TimeDesignation>,
    pub fetch_hint: FetchHint,
    pub max_age: Option<usize>,
    pub max_stale: Option<usize>,
    pub clip_begin: TimeDesignation,
    pub clip_end: Option<TimeDesignation>,
    pub repeat_count: NonZeroUsize,
    pub repeat_dur: Option<TimeDesignation>,
    pub sound_level: f32,
    pub speed: f32,
}
Expand description

The audio element supports the insertion of recorded audio files and the insertion of other audio formats in conjunction with synthesized speech output. The audio element may be empty. If the audio element is not empty then the contents should be the marked-up text to be spoken if the audio document is not available. The alternate content may include text, speech markup, desc elements, or other audio elements. The alternate content may also be used when rendering the document to non-audible output and for accessibility (see the desc element).

“Speech Synthesis Markup Language (SSML) Version 1.1” Copyright © 2010 W3C® (MIT, ERCIM, Keio), All Rights Reserved.

Fields§

§src: Option<Uri>

The URI of a document with an appropriate media type. If absent, the audio element behaves as if src were present with a legal URI but the document could not be fetched.

§fetch_timeout: Option<TimeDesignation>

The timeout for fetches.

§fetch_hint: FetchHint

This tells the synthesis processor whether or not it can attempt to optimize rendering by pre-fetching audio. The value is either safe to say that audio is only fetched when it is needed, never before; or prefetch to permit, but not require the processor to pre-fetch the audio.

§max_age: Option<usize>

Indicates that the document is willing to use content whose age is no greater than the specified time (cf. ‘max-age’ in HTTP 1.1). The document is not willing to use stale content, unless maxstale is also provided.

§max_stale: Option<usize>

Indicates that the document is willing to use content that has exceeded its expiration time (cf. ‘max-stale’ in HTTP 1.1). If maxstale is assigned a value, then the document is willing to accept content that has exceeded its expiration time by no more than the specified amount of time.

§clip_begin: TimeDesignation

offset from start of media to begin rendering. This offset is measured in normal media playback time from the beginning of the media.

§clip_end: Option<TimeDesignation>

offset from start of media to end rendering. This offset is measured in normal media playback time from the beginning of the media.

§repeat_count: NonZeroUsize

number of iterations of media to render. A fractional value describes a portion of the rendered media.

§repeat_dur: Option<TimeDesignation>

total duration for repeatedly rendering media. This duration is measured in normal media playback time from the beginning of the media.

§sound_level: f32

Sound level in decibels

§speed: f32

Speed in a percentage where 1.0 corresponds to 100%

Trait Implementations§

Source§

impl Clone for AudioAttributes

Source§

fn clone(&self) -> AudioAttributes

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AudioAttributes

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for AudioAttributes

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for AudioAttributes

Source§

fn eq(&self, other: &AudioAttributes) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for AudioAttributes

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.