---
title: "LocalSoundEffect"
description: "The CompositionLocal to provide platform sound effects."
type: "property"
lastmod: "2026-05-20T01:13:53.411574Z"
---
## API Reference

> Source set: Common

```kotlin
val LocalSoundEffect =
staticCompositionLocalOf<SoundEffect> {
    object : SoundEffect {
        override fun playClickSound() {
        }
    }
}
```

The CompositionLocal to provide platform sound effects.

This is used to trigger sounds on user interaction, like clicks. To enable, disable, or customize
sound interaction scopes, utilize `SoundEffectOnInteraction`.

## Code Examples

### InteractionSoundSamples
```kotlin
@Composable
fun InteractionSoundSamples() {
    Column(modifier = Modifier.padding(16.dp)) {
        Text("Standard Clickable (Has Sound):")
        Button(onClick = {}) { Text("Click me") }
        Text("\nDisabled Sound Feedback:")
        SoundEffectOnInteraction(enabled = false) { Button(onClick = {}) { Text("Silent Button") } }
    }
}
```
