# SoundEffectOnInteraction

Common/AllAndroid/JVM

## Functions summary

|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/SoundEffectOnInteraction.composable#SoundEffectOnInteraction(kotlin.Boolean,kotlin.Function0)(enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Configure whether sound effects are played for interactions (clicks) in the provided `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/package-summary#SoundEffectOnInteraction(kotlin.Boolean,kotlin.Function0)`. | android |

## Functions

### SoundEffectOnInteraction

android Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/platform/SoundEffectOnInteraction.android.kt+function:SoundEffectOnInteraction)

```
@Composable
fun SoundEffectOnInteraction(enabled: Boolean, content: @Composable () -> Unit): Unit
```

Configure whether sound effects are played for interactions (clicks) in the provided `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/package-summary#SoundEffectOnInteraction(kotlin.Boolean,kotlin.Function0)`. This acts as a configuration wrapper that intercepts the `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/package-summary#LocalSoundEffect()` and conditionally delegates or drops invocations of `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/SoundEffect#playClickSound()`.

| Parameters |
|---|---|
| `enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if sound effects should be played on user interactions, false to silence them. |
| `content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | The composable subtree to wrap. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/package-summary#LocalSoundEffect()` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/SoundEffect` |   |