# SoundEffect

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/SoundEffect.kt+class:androidx.compose.ui.platform.SoundEffect) Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.12.0) Common/AllAndroid/JVM
- Cmn

  ```
  interface SoundEffect
  ```

*** ** * ** ***

Interface representing the capability to play sound effects on user interaction.

This is used primarily to play interaction sound effects for click gestures.

```kotlin
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.Text
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.SoundEffectOnInteraction
import androidx.compose.ui.unit.dp

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") } }
}
```

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

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/SoundEffect#playClickSound()()` Plays a click sound effect. | Cmn |

## Public functions

### playClickSound

Cmn Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.12.0)

```
fun playClickSound(): Unit
```

Plays a click sound effect.

This method triggers the standard click sound effect, provided it is supported by the platform, enabled by the user's system, and has not been silenced or customized via `SoundEffectOnInteraction`.