Added in API level 29

AudioPlaybackCaptureConfiguration


class AudioPlaybackCaptureConfiguration
kotlin.Any
   ↳ 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

Builder for creating AudioPlaybackCaptureConfiguration instances.

Public methods
IntArray

IntArray

IntArray

IntArray

MediaProjection

Public methods

getExcludeUids

Added in API level 29
fun getExcludeUids(): IntArray
Return
IntArray the UIDs passed to Builder#excludeUid(int). This value cannot be null.

getMatchingUids

Added in API level 29
fun getMatchingUids(): IntArray
Return
IntArray the UIDs passed to Builder#addMatchingUid(int). This value cannot be null.

getMediaProjection

Added in API level 29
fun getMediaProjection(): MediaProjection
Return
MediaProjection the MediaProjection used to build this object. This value cannot be null.