AudioPlaybackCaptureConfiguration


public final class AudioPlaybackCaptureConfiguration
extends Object

java.lang.Object
   ↳ android.media.AudioPlaybackCaptureConfiguration


Configuration for capturing audio played by other apps. When capturing audio signals played by other apps (and yours), you will only capture a mix of the audio signals played by players (such as AudioTrack or MediaPlayer) which present the following characteristics:

An example for creating a capture configuration for capturing all media playback:

     MediaProjection mediaProjection;
     // Retrieve a audio capable projection from the MediaProjectionManager
     AudioPlaybackCaptureConfiguration config =
         new AudioPlaybackCaptureConfiguration.Builder(mediaProjection)
         .addMatchingUsage(AudioAttributes.USAGE_MEDIA)
         .build();
     AudioRecord record = new AudioRecord.Builder()
         .setAudioPlaybackCaptureConfig(config)
         .build();
 

Summary

Nested classes

class AudioPlaybackCaptureConfiguration.Builder

Builder for creating AudioPlaybackCaptureConfiguration instances. 

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

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

void finalize()

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

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

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

final void notifyAll()

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

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

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

final void wait(long timeoutMillis)

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

final void wait()

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

Public methods

getExcludeUids

Added in API level 29
public int[] getExcludeUids ()

Returns
int[] the UIDs passed to Builder.excludeUid(int). This value cannot be null.

getExcludeUsages

Added in API level 29
public int[] getExcludeUsages ()

getMatchingUids

Added in API level 29
public int[] getMatchingUids ()

Returns
int[] the UIDs passed to Builder.addMatchingUid(int). This value cannot be null.

getMatchingUsages

Added in API level 29
public int[] getMatchingUsages ()

getMediaProjection

Added in API level 29
public MediaProjection getMediaProjection ()

Returns
MediaProjection the MediaProjection used to build this object. This value cannot be null.