次の方法で共有


AudioAttributes Class

Definition

A class to encapsulate a collection of attributes describing information about an audio stream.

[Android.Runtime.Register("android/media/AudioAttributes", DoNotGenerateAcw=true)]
public sealed class AudioAttributes : Java.Lang.Object, Android.OS.IParcelable, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/media/AudioAttributes", DoNotGenerateAcw=true)>]
type AudioAttributes = class
    inherit Object
    interface IParcelable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
AudioAttributes
Attributes
Implements

Remarks

A class to encapsulate a collection of attributes describing information about an audio stream.

AudioAttributes supersede the notion of stream types (see for instance AudioManager#STREAM_MUSIC or AudioManager#STREAM_ALARM) for defining the behavior of audio playback. Attributes allow an application to specify more information than is conveyed in a stream type by allowing the application to define: <ul> <li>usage: "why" you are playing a sound, what is this sound used for. This is achieved with the "usage" information. Examples of usage are #USAGE_MEDIA and #USAGE_ALARM. These two examples are the closest to stream types, but more detailed use cases are available. Usage information is more expressive than a stream type, and allows certain platforms or routing policies to use this information for more refined volume or routing decisions. Usage is the most important information to supply in AudioAttributes and it is recommended to build any instance with this information supplied, see AudioAttributes.Builder for exceptions.</li> <li>content type: "what" you are playing. The content type expresses the general category of the content. This information is optional. But in case it is known (for instance #CONTENT_TYPE_MOVIE for a movie streaming service or #CONTENT_TYPE_MUSIC for a music playback application) this information might be used by the audio framework to selectively configure some audio post-processing blocks.</li> <li>flags: "how" is playback to be affected, see the flag definitions for the specific playback behaviors they control. </li> </ul>

AudioAttributes are used for example in one of the AudioTrack constructors (see AudioTrack#AudioTrack(AudioAttributes, AudioFormat, int, int, int)), to configure a MediaPlayer (see MediaPlayer#setAudioAttributes(AudioAttributes) or a android.app.Notification (see android.app.Notification#audioAttributes). An AudioAttributes instance is built through its builder, AudioAttributes.Builder.

Java documentation for android.media.AudioAttributes.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Fields

AllowCaptureByAll
Obsolete.

Indicates that the audio may be captured by any app.

AllowCaptureByNone
Obsolete.

Indicates that the audio is not to be recorded by any app, even if it is a system app.

AllowCaptureBySystem
Obsolete.

Indicates that the audio may only be captured by system apps.

SpatializationBehaviorAuto
Obsolete.

Constant indicating the audio content associated with these attributes will follow the default platform behavior with regards to which content will be spatialized or not.

SpatializationBehaviorNever
Obsolete.

Constant indicating the audio content associated with these attributes should never be virtualized.

Properties

AllowedCapturePolicy

Return the capture policy.

Class

Returns the runtime class of this Object.

(Inherited from Object)
ContentType

Return the content type.

Creator
Flags

Return the flags.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsContentSpatialized

Return true if the audio content associated with these attributes has already been spatialized, that is it has already been processed to offer a binaural or transaural immersive audio experience.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
SpatializationBehavior

Return the behavior affecting whether spatialization will be used.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
Usage

Return the usage.

VolumeControlStream

Returns the stream type matching this AudioAttributes instance for volume control.

Methods

AreHapticChannelsMuted()

Return if haptic channels are muted.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
DescribeContents()

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
WriteToParcel(Parcel, ParcelableWriteFlags)

Flatten this object in to a Parcel.

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to