共用方式為


AudioEffect Class

Definition

AudioEffect is the base class for controlling audio effects provided by the android audio framework.

[Android.Runtime.Register("android/media/audiofx/AudioEffect", DoNotGenerateAcw=true)]
public class AudioEffect : Java.Lang.Object
[<Android.Runtime.Register("android/media/audiofx/AudioEffect", DoNotGenerateAcw=true)>]
type AudioEffect = class
    inherit Object
Inheritance
AudioEffect
Derived
Attributes

Remarks

AudioEffect is the base class for controlling audio effects provided by the android audio framework.

Applications should not use the AudioEffect class directly but one of its derived classes to control specific effects: <ul> <li> android.media.audiofx.Equalizer</li> <li> android.media.audiofx.Virtualizer</li> <li> android.media.audiofx.BassBoost</li> <li> android.media.audiofx.PresetReverb</li> <li> android.media.audiofx.EnvironmentalReverb</li> <li> android.media.audiofx.DynamicsProcessing</li> <li> android.media.audiofx.HapticGenerator</li> </ul>

To apply the audio effect to a specific AudioTrack or MediaPlayer instance, the application must specify the audio session ID of that instance when creating the AudioEffect. (see android.media.MediaPlayer#getAudioSessionId() for details on audio sessions).

NOTE: attaching insert effects (equalizer, bass boost, virtualizer) to the global audio output mix by use of session 0 is deprecated.

Creating an AudioEffect object will create the corresponding effect engine in the audio framework if no instance of the same effect type exists in the specified audio session. If one exists, this instance will be used.

The application creating the AudioEffect object (or a derived class) will either receive control of the effect engine or not depending on the priority parameter. If priority is higher than the priority used by the current effect engine owner, the control will be transfered to the new object. Otherwise control will remain with the previous object. In this case, the new application will be notified of changes in effect engine state or control ownership by the appropriate listener.

Java documentation for android.media.audiofx.AudioEffect.

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.

Constructors

AudioEffect(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Fields

ActionCloseAudioEffectControlSession

Intent to signal to the effect control application or service that an audio session is closed and that effects should not be applied anymore.

ActionDisplayAudioEffectControlPanel

Intent to launch an audio effect control panel UI.

ActionOpenAudioEffectControlSession

Intent to signal to the effect control application or service that a new audio session is opened and requires audio effects to be applied.

AlreadyExists
Obsolete.

Internal operation status.

ContentTypeGame
Obsolete.

Value for #EXTRA_CONTENT_TYPE when the type of content played is game audio

ContentTypeMovie
Obsolete.

Value for #EXTRA_CONTENT_TYPE when the type of content played is video or movie

ContentTypeMusic
Obsolete.

Value for #EXTRA_CONTENT_TYPE when the type of content played is music

ContentTypeVoice
Obsolete.

Value for #EXTRA_CONTENT_TYPE when the type of content played is voice audio

EffectAuxiliary

Effect connection mode is auxiliary.

EffectInsert

Effect connection mode is insert.

EffectPostProcessing

Effect connection mode is post processing.

EffectPreProcessing

Effect connection mode is pre processing.

Error
Obsolete.

Unspecified error.

ErrorBadValue
Obsolete.

Operation failed due to bad parameter value.

ErrorDeadObject
Obsolete.

Operation failed due to dead remote object.

ErrorInvalidOperation
Obsolete.

Operation failed because it was requested in wrong state.

ErrorNoInit
Obsolete.

Operation failed due to bad object initialization.

ErrorNoMemory
Obsolete.

Operation failed due to lack of memory.

ExtraAudioSession

Contains the ID of the audio session the effects should be applied to.

ExtraContentType

Indicates which type of content is played by the application.

ExtraPackageName

Contains the package name of the calling application.

Success
Obsolete.

Successful operation.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
EffectTypeAec

UUID for Acoustic Echo Canceler (AEC)

EffectTypeAgc

UUID for Automatic Gain Control (AGC)

EffectTypeBassBoost

UUID for bass boost effect

EffectTypeDynamicsProcessing

UUID for Dynamics Processing

EffectTypeEnvReverb

UUID for environmental reverberation effect

EffectTypeEqualizer

UUID for equalizer effect

EffectTypeHapticGenerator

The following UUIDs define effect types corresponding to standard audio effects whose implementation and interface conform to the OpenSL ES specification.

EffectTypeLoudnessEnhancer

UUID for Loudness Enhancer

EffectTypeNs

UUID for Noise Suppressor (NS)

EffectTypePresetReverb

UUID for preset reverberation effect

EffectTypeVirtualizer

UUID for virtualizer effect

Enabled

Returns effect enabled state

Handle

The handle to the underlying Android instance.

(Inherited from Object)
HasControl

Checks if this AudioEffect object is controlling the effect engine.

Id

Returns effect unique identifier.

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

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

ThresholdType

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

Methods

Clone()

Creates and returns a copy of this object.

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

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

(Inherited from Object)
GetDescriptor()

Get the effect descriptor.

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)
QueryEffects()

Query all effects available on the platform.

Release()

Releases the native AudioEffect resources.

SetControlStatusListener(AudioEffect+IOnControlStatusChangeListener)

Sets the listener AudioEffect notifies when the effect engine control is taken or returned.

SetEnabled(Boolean)

Enable or disable the effect.

SetEnableStatusListener(AudioEffect+IOnEnableStatusChangeListener)

Sets the listener AudioEffect notifies when the effect engine is enabled or disabled.

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)

Events

ControlStatus
EnableStatus

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