Class ShadowAudioEffect

  • Direct Known Subclasses:
    ShadowDynamicsProcessing

    @Implements(android.media.audiofx.AudioEffect.class)
    public class ShadowAudioEffect
    extends java.lang.Object
    Implements AudioEffect by shadowing its native methods.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void addEffect​(android.media.audiofx.AudioEffect.Descriptor descriptor)
      Adds an effect represented by an AudioEffect.Descriptor, only to be queried from queryEffects().
      static com.google.common.collect.ImmutableList<android.media.audiofx.AudioEffect> getAudioEffects()
      Returns all effects created with an AudioEffect constructor.
      int getAudioSession()
      Returns the audio session set in the AudioEffect ctor.
      protected java.util.Optional<java.nio.ByteBuffer> getDefaultParameter​(java.nio.ByteBuffer parameter)
      Allows sub-classes to provide default parameters.
      int getPriority()
      Returns the priority set in the AudioEffect ctor.
      protected boolean native_getEnabled()
      Returns whether the AudioEffect is enabled (as per native_setEnabled(boolean)).
      protected int native_getParameter​(int psize, byte[] param, int vsize, byte[] value)
      Gets the value of the parameter with key param, by putting its value in value.
      protected void native_release()
      Removes this audio effect from the set of active audio effects.
      protected int native_setEnabled​(boolean enabled)
      Marks the AudioEffect as enabled, and always returns SUCCESS.
      protected int native_setParameter​(int psize, byte[] param, int vsize, byte[] value)
      Sets the parameter with the given key param to the given value value.
      protected int native_setup​(java.lang.Object audioEffectThis, java.lang.String type, java.lang.String uuid, int priority, int audioSession, int[] id, java.lang.Object[] desc)  
      protected int native_setup​(java.lang.Object audioEffectThis, java.lang.String type, java.lang.String uuid, int priority, int audioSession, int[] id, java.lang.Object[] desc, java.lang.String opPackageName)  
      protected static android.media.audiofx.AudioEffect.Descriptor[] queryEffects()
      Returns the set of audio effects added through addEffect(android.media.audiofx.AudioEffect.Descriptor).
      static void reset()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ShadowAudioEffect

        public ShadowAudioEffect()
    • Method Detail

      • native_setup

        @Implementation(minSdk=16,
                        maxSdk=22)
        protected int native_setup​(java.lang.Object audioEffectThis,
                                   java.lang.String type,
                                   java.lang.String uuid,
                                   int priority,
                                   int audioSession,
                                   int[] id,
                                   java.lang.Object[] desc)
      • native_setup

        @Implementation(minSdk=23,
                        maxSdk=29)
        protected int native_setup​(java.lang.Object audioEffectThis,
                                   java.lang.String type,
                                   java.lang.String uuid,
                                   int priority,
                                   int audioSession,
                                   int[] id,
                                   java.lang.Object[] desc,
                                   java.lang.String opPackageName)
      • native_setEnabled

        @Implementation
        protected int native_setEnabled​(boolean enabled)
        Marks the AudioEffect as enabled, and always returns SUCCESS.
      • native_getEnabled

        @Implementation
        protected boolean native_getEnabled()
        Returns whether the AudioEffect is enabled (as per native_setEnabled(boolean)).
      • native_setParameter

        @Implementation
        protected int native_setParameter​(int psize,
                                          byte[] param,
                                          int vsize,
                                          byte[] value)
        Sets the parameter with the given key param to the given value value.
        Returns:
        always SUCCESS
      • native_getParameter

        @Implementation
        protected int native_getParameter​(int psize,
                                          byte[] param,
                                          int vsize,
                                          byte[] value)
        Gets the value of the parameter with key param, by putting its value in value.

        Note: Sub-classes of ShadowAudioEffect can declare default values for any parameters. Note: If the given parameter has not been set, and there is no default value for that parameter, then we "return" (set value to) a single integer 0.

        Returns:
        the size of the returned value, in bytes.
      • getDefaultParameter

        protected java.util.Optional<java.nio.ByteBuffer> getDefaultParameter​(java.nio.ByteBuffer parameter)
        Allows sub-classes to provide default parameters.

        Override this method to provide default parameters.

      • getPriority

        public int getPriority()
        Returns the priority set in the AudioEffect ctor.
      • getAudioSession

        public int getAudioSession()
        Returns the audio session set in the AudioEffect ctor.
      • addEffect

        public static void addEffect​(android.media.audiofx.AudioEffect.Descriptor descriptor)
        Adds an effect represented by an AudioEffect.Descriptor, only to be queried from queryEffects().
      • getAudioEffects

        public static com.google.common.collect.ImmutableList<android.media.audiofx.AudioEffect> getAudioEffects()
        Returns all effects created with an AudioEffect constructor.
      • native_release

        @Implementation
        protected void native_release()
        Removes this audio effect from the set of active audio effects.
      • reset

        @Resetter
        public static void reset()