#[repr(u32)]
pub enum AudioUsage {
Show 16 variants Media, VoiceCommunication, VoiceCommunicationSignalling, Alarm, Notification, NotificationRingtone, NotificationEvent, AssistanceAccessibility, AssistanceNavigationGuidance, AssistanceSonification, Game, Assistant, SystemEmergency, SystemSafety, SystemVehicleStatus, SystemAnnouncement,
}
Available on crate features audio and api-level-28 only.
Expand description

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.

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.

SystemEmergency

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

SystemSafety

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

SystemVehicleStatus

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

SystemAnnouncement

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.