Enum ndk::audio::AudioUsage
source · [−]#[repr(u32)]
pub enum AudioUsage {
Show 16 variants
Media,
VoiceCommunication,
VoiceCommunicationSignalling,
Alarm,
Notification,
NotificationRingtone,
NotificationEvent,
AssistanceAccessibility,
AssistanceNavigationGuidance,
AssistanceSonification,
Game,
Assistant,
SystemEmergency,
SystemSafety,
SystemVehicleStatus,
SystemAnnouncement,
}
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
sourceimpl Clone for AudioUsage
impl Clone for AudioUsage
sourcefn clone(&self) -> AudioUsage
fn clone(&self) -> AudioUsage
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for AudioUsage
impl Debug for AudioUsage
sourceimpl From<AudioUsage> for u32
impl From<AudioUsage> for u32
sourcefn from(enum_value: AudioUsage) -> Self
fn from(enum_value: AudioUsage) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<AudioUsage> for AudioUsage
impl PartialEq<AudioUsage> for AudioUsage
sourceimpl TryFrom<u32> for AudioUsage
impl TryFrom<u32> for AudioUsage
type Error = TryFromPrimitiveError<AudioUsage>
type Error = TryFromPrimitiveError<AudioUsage>
The type returned in the event of a conversion error.
sourcefn try_from(number: u32) -> Result<Self, TryFromPrimitiveError<Self>>
fn try_from(number: u32) -> Result<Self, TryFromPrimitiveError<Self>>
Performs the conversion.
sourceimpl TryFromPrimitive for AudioUsage
impl TryFromPrimitive for AudioUsage
type Primitive = u32
const NAME: &'static str = _
fn try_from_primitive(
number: Self::Primitive
) -> Result<Self, TryFromPrimitiveError<Self>>
impl Copy for AudioUsage
impl Eq for AudioUsage
impl StructuralEq for AudioUsage
impl StructuralPartialEq for AudioUsage
Auto Trait Implementations
impl RefUnwindSafe for AudioUsage
impl Send for AudioUsage
impl Sync for AudioUsage
impl Unpin for AudioUsage
impl UnwindSafe for AudioUsage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more