play

fun play(sound: UncivSound)

Find, cache and play a Sound

Sources are mods from a loaded game, then mods marked as permanent audiovisual, and lastly Unciv's own assets/sounds. Will fail silently if the sound file cannot be found.

This will wait for the Stream to become ready (Android issue) if necessary, and do so on a separate thread. No new thread is created if the sound can be played immediately.

Parameters

sound

The sound to play

Sources

jvm source
Link copied to clipboard