# OpenMicrophoneResponse

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/media/OpenMicrophoneResponse.java+class:androidx.car.app.media.OpenMicrophoneResponse) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

*** ** * ** ***


```
@CarProtocol
@RequiresCarApi(value = 5)
public final class OpenMicrophoneResponse
```

<br />

*** ** * ** ***

The response for a call to open microphone.

This is a host-side interface for handling audio callbacks. To record the microphone, use `https://developer.android.com/reference/androidx/car/app/media/CarAudioRecord`.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/car/app/media/OpenMicrophoneResponse.Builder` A builder for `https://developer.android.com/reference/androidx/car/app/media/OpenMicrophoneResponse`s. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/media/CarAudioCallbackDelegate` | `https://developer.android.com/reference/androidx/car/app/media/OpenMicrophoneResponse#getCarAudioCallback()()` Returns the callback to use to communicate recording state. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/io/InputStream.html` | `https://developer.android.com/reference/androidx/car/app/media/OpenMicrophoneResponse#getCarMicrophoneInputStream()()` Returns an `https://developer.android.com/reference/java/io/InputStream.html` to read the microphone bytes from. |

## Public methods

### getCarAudioCallback

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
public @NonNull CarAudioCallbackDelegate getCarAudioCallback()
```

Returns the callback to use to communicate recording state.

### getCarMicrophoneInputStream

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
public @NonNull InputStream getCarMicrophoneInputStream()
```

Returns an `https://developer.android.com/reference/java/io/InputStream.html` to read the microphone bytes from.