AudioPlaybackCaptureConfiguration
public
final
class
AudioPlaybackCaptureConfiguration
extends Object
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 |
From class
java.lang.Object
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 timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
|
Public methods
getExcludeUids
public int[] getExcludeUids ()
getExcludeUsages
public int[] getExcludeUsages ()
Returns |
int[] |
the usages passed to Builder#excludeUsage(int) .
Value is AudioAttributes.USAGE_UNKNOWN , AudioAttributes.USAGE_MEDIA , AudioAttributes.USAGE_VOICE_COMMUNICATION , AudioAttributes.USAGE_VOICE_COMMUNICATION_SIGNALLING , AudioAttributes.USAGE_ALARM , AudioAttributes.USAGE_NOTIFICATION , AudioAttributes.USAGE_NOTIFICATION_RINGTONE , AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_REQUEST , AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_INSTANT , AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_DELAYED , AudioAttributes.USAGE_NOTIFICATION_EVENT , AudioAttributes.USAGE_ASSISTANCE_ACCESSIBILITY , AudioAttributes.USAGE_ASSISTANCE_NAVIGATION_GUIDANCE , AudioAttributes.USAGE_ASSISTANCE_SONIFICATION , AudioAttributes.USAGE_GAME , AudioAttributes.USAGE_ASSISTANT , android.media.AudioAttributes.USAGE_CALL_ASSISTANT, android.media.AudioAttributes.USAGE_EMERGENCY, android.media.AudioAttributes.USAGE_SAFETY, android.media.AudioAttributes.USAGE_VEHICLE_STATUS, or android.media.AudioAttributes.USAGE_ANNOUNCEMENT
This value cannot be null . |
getMatchingUids
public int[] getMatchingUids ()
getMatchingUsages
public int[] getMatchingUsages ()
Returns |
int[] |
the usages passed to Builder#addMatchingUsage(int) .
Value is AudioAttributes.USAGE_UNKNOWN , AudioAttributes.USAGE_MEDIA , AudioAttributes.USAGE_VOICE_COMMUNICATION , AudioAttributes.USAGE_VOICE_COMMUNICATION_SIGNALLING , AudioAttributes.USAGE_ALARM , AudioAttributes.USAGE_NOTIFICATION , AudioAttributes.USAGE_NOTIFICATION_RINGTONE , AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_REQUEST , AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_INSTANT , AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_DELAYED , AudioAttributes.USAGE_NOTIFICATION_EVENT , AudioAttributes.USAGE_ASSISTANCE_ACCESSIBILITY , AudioAttributes.USAGE_ASSISTANCE_NAVIGATION_GUIDANCE , AudioAttributes.USAGE_ASSISTANCE_SONIFICATION , AudioAttributes.USAGE_GAME , AudioAttributes.USAGE_ASSISTANT , android.media.AudioAttributes.USAGE_CALL_ASSISTANT, android.media.AudioAttributes.USAGE_EMERGENCY, android.media.AudioAttributes.USAGE_SAFETY, android.media.AudioAttributes.USAGE_VEHICLE_STATUS, or android.media.AudioAttributes.USAGE_ANNOUNCEMENT
This value cannot be null . |