[][src]Enum aaudio::Usage

pub enum Usage {
    Media,
    VoiceCommunication,
    VoiceCommunicationSignalling,
    Alarm,
    Notification,
    NotificationRingtone,
    NotificationEvent,
    AssistanceAccessibility,
    AssistanceNavigationGuidance,
    AssistanceSonification,
    Game,
    Assistant,
    Emergency,
    Safety,
    VehicleStatus,
    Announcement,
}

The Usage attribute expresses "why" you are playing a sound, what is this sound used for. This information is used by certain platforms or routing policies to make more refined volume or routing decisions.

Note that these match the equivalent values in android.media.AudioAttributes in the Android Java API.

Added in API level 28.

Variants

Media

Use this for streaming media, music performance, video, podcasts, etcetera.

VoiceCommunication

Use this for voice over IP, telephony, etcetera.

VoiceCommunicationSignalling

Use this for sounds associated with telephony such as busy tones, DTMF, etcetera.

Alarm

Use this to demand the users attention.

Notification

Use this for notifying the user when a message has arrived or some other background event has occured.

NotificationRingtone

Use this when the phone rings.

NotificationEvent

Use this to attract the users attention when, for example, the battery is low.

AssistanceAccessibility

Use this for screen readers, etcetera.

AssistanceNavigationGuidance

Use this for driving or navigation directions.

AssistanceSonification

Use this for user interface sounds, beeps, etcetera.

Game

Use this for game audio and sound effects.

Assistant

Use this for audio responses to user queries, audio instructions or help utterances.

Emergency

Use this in case of playing sounds in an emergency. Privileged MODIFY_AUDIO_ROUTING permission required.

Safety

Use this for safety sounds and alerts, for example backup camera obstacle detection. Privileged MODIFY_AUDIO_ROUTING permission required.

VehicleStatus

Use this for vehicle status alerts and information, for example the check engine light. Privileged MODIFY_AUDIO_ROUTING permission required.

Announcement

Use this for traffic announcements, etc. Privileged MODIFY_AUDIO_ROUTING permission required.

Trait Implementations

impl Clone for Usage[src]

impl Copy for Usage[src]

impl Debug for Usage[src]

impl Eq for Usage[src]

impl PartialEq<Usage> for Usage[src]

impl StructuralEq for Usage[src]

impl StructuralPartialEq for Usage[src]

Auto Trait Implementations

impl RefUnwindSafe for Usage

impl Send for Usage

impl Sync for Usage

impl Unpin for Usage

impl UnwindSafe for Usage

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.