# OpenMicrophoneResponse

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/car/app/media/OpenMicrophoneResponse "View this page in Java")

<br />

```
@CarProtocol
@RequiresCarApi(value = 5)
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[CarAudioRecord](https://developer.android.com/reference/kotlin/androidx/car/app/media/CarAudioRecord).

## Summary

|                                                                                                                                   ### Nested types                                                                                                                                   |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[OpenMicrophoneResponse.Builder](https://developer.android.com/reference/kotlin/androidx/car/app/media/OpenMicrophoneResponse.Builder) A builder for[OpenMicrophoneResponse](https://developer.android.com/reference/kotlin/androidx/car/app/media/OpenMicrophoneResponse)s. |

|                                                    ### Public functions                                                    |
|----------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [CarAudioCallbackDelegate](https://developer.android.com/reference/kotlin/androidx/car/app/media/CarAudioCallbackDelegate) | [getCarAudioCallback](https://developer.android.com/reference/kotlin/androidx/car/app/media/OpenMicrophoneResponse#getCarAudioCallback())`()` Returns the callback to use to communicate recording state.                                                                                 |
| [InputStream](https://developer.android.com/reference/java/io/InputStream.html)                                            | [getCarMicrophoneInputStream](https://developer.android.com/reference/kotlin/androidx/car/app/media/OpenMicrophoneResponse#getCarMicrophoneInputStream())`()` Returns an[InputStream](https://developer.android.com/reference/java/io/InputStream.html)to read the microphone bytes from. |

## Public functions

### getCarAudioCallback

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

```
fun getCarAudioCallback(): CarAudioCallbackDelegate
```

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)  

```
fun getCarMicrophoneInputStream(): InputStream
```

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