Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/media/AudioRecordingMonitor#pubmethods)

# AudioRecordingMonitor

*** ** * ** ***

` public interface AudioRecordingMonitor `   
` `

|---|
| android.media.AudioRecordingMonitor |

Known indirect subclasses [AudioRecord](https://developer.android.com/reference/android/media/AudioRecord), [MediaRecorder](https://developer.android.com/reference/android/media/MediaRecorder) [AudioRecord](https://developer.android.com/reference/android/media/AudioRecord) The AudioRecord class manages the audio resources for Java applications to record audio from the audio input hardware of the platform. [MediaRecorder](https://developer.android.com/reference/android/media/MediaRecorder) Used to record audio and video.   

*** ** * ** ***

AudioRecordingMonitor defines an interface implemented by `https://developer.android.com/reference/android/media/AudioRecord` and `https://developer.android.com/reference/android/media/MediaRecorder` allowing applications to install a callback and be notified of changes in the capture path while recoding is active.

## Summary

| ### Public methods ||
|---|---|
| ` abstract https://developer.android.com/reference/android/media/AudioRecordingConfiguration` | ` https://developer.android.com/reference/android/media/AudioRecordingMonitor#getActiveRecordingConfiguration()() ` Returns the current active audio recording for this audio recorder. |
| ` abstract void` | ` https://developer.android.com/reference/android/media/AudioRecordingMonitor#registerAudioRecordingCallback(java.util.concurrent.Executor,%20android.media.AudioManager.AudioRecordingCallback)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/media/AudioManager.AudioRecordingCallback cb) ` Register a callback to be notified of audio capture changes via a `https://developer.android.com/reference/android/media/AudioManager.AudioRecordingCallback`. |
| ` abstract void` | ` https://developer.android.com/reference/android/media/AudioRecordingMonitor#unregisterAudioRecordingCallback(android.media.AudioManager.AudioRecordingCallback)(https://developer.android.com/reference/android/media/AudioManager.AudioRecordingCallback cb) ` Unregister an audio recording callback previously registered with `https://developer.android.com/reference/android/media/AudioRecordingMonitor#registerAudioRecordingCallback(java.util.concurrent.Executor,%20android.media.AudioManager.AudioRecordingCallback)`. |

## Public methods

### getActiveRecordingConfiguration

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract AudioRecordingConfiguration getActiveRecordingConfiguration ()
```

Returns the current active audio recording for this audio recorder.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/media/AudioRecordingConfiguration` | a valid `https://developer.android.com/reference/android/media/AudioRecordingConfiguration` if this recorder is active or null otherwise. <br /> |

**See also:**

- `https://developer.android.com/reference/android/media/AudioRecordingConfiguration`

### registerAudioRecordingCallback

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract void registerAudioRecordingCallback (Executor executor, 
                AudioManager.AudioRecordingCallback cb)
```

Register a callback to be notified of audio capture changes via a `https://developer.android.com/reference/android/media/AudioManager.AudioRecordingCallback`. A callback is received when the capture path configuration changes (pre-processing, format, sampling rate...) or capture is silenced/unsilenced by the system.

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: `https://developer.android.com/reference/java/util/concurrent/Executor` to handle the callbacks. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `cb` | `AudioManager.AudioRecordingCallback`: non-null callback to register <br /> |

### unregisterAudioRecordingCallback

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract void unregisterAudioRecordingCallback (AudioManager.AudioRecordingCallback cb)
```

Unregister an audio recording callback previously registered with `https://developer.android.com/reference/android/media/AudioRecordingMonitor#registerAudioRecordingCallback(java.util.concurrent.Executor,%20android.media.AudioManager.AudioRecordingCallback)`.

<br />

| Parameters ||
|---|---|
| `cb` | `AudioManager.AudioRecordingCallback`: non-null callback to unregister <br /> |