# AudioConfig

Artifact: [androidx.camera:camera-view](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/view/video/AudioConfig.java+class:androidx.camera.view.video.AudioConfig) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/camera#1.3.0)

*** ** * ** ***


```
class AudioConfig
```

<br />

*** ** * ** ***

A class providing configuration for audio settings in the video recording.

## Summary

| ### Constants |
|---|---|
| `const https://developer.android.com/reference/kotlin/androidx/camera/view/video/AudioConfig` | `https://developer.android.com/reference/kotlin/androidx/camera/view/video/AudioConfig#AUDIO_DISABLED()` The audio configuration with audio disabled. |

| ### Public functions |
|---|---|
| `java-static https://developer.android.com/reference/kotlin/androidx/camera/view/video/AudioConfig` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresPermission(value = https://developer.android.com/reference/android/Manifest.permission.html#RECORD_AUDIO) https://developer.android.com/reference/kotlin/androidx/camera/view/video/AudioConfig#create(boolean)(enableAudio: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Creates a default `https://developer.android.com/reference/kotlin/androidx/camera/view/video/AudioConfig` with the given audio enabled state. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/view/video/AudioConfig#getAudioEnabled()()` Get the audio enabled state. |

## Constants

### AUDIO_DISABLED

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

```
const val AUDIO_DISABLED: AudioConfig
```

The audio configuration with audio disabled.

## Public functions

### create

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

```
@RequiresPermission(value = Manifest.permission.RECORD_AUDIO)
java-static fun create(enableAudio: Boolean): AudioConfig
```

Creates a default `https://developer.android.com/reference/kotlin/androidx/camera/view/video/AudioConfig` with the given audio enabled state.

The `https://developer.android.com/reference/android/Manifest.permission.html#RECORD_AUDIO` permission is required to enable audio in video recording; for the use cases where audio is always disabled, please use `https://developer.android.com/reference/kotlin/androidx/camera/view/video/AudioConfig#AUDIO_DISABLED()` instead, which has no permission requirements.

### getAudioEnabled

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

```
fun getAudioEnabled(): Boolean
```

Get the audio enabled state.