.. _stdlib_sounds: ================ Sounds ================ ++++++++++ Formats ++++++++++ We support the following formats: ``.mp3``, ``.ogg``, ``.wav``, and ``.flac``. ++++++++++ Import Window ++++++++++ .. image:: sound_import_window.jpg :width: 400 :alt: sound_import_window .. line-block:: In the Import Window, you can play sounds and change their import settings. Load Type Options: * **OnLoad** - Decodes the audio resource on load. This is good for short sounds, but can cause CPU spikes with very long audio files and stores all audio data in memory. * **Streaming** - Uses streaming decoding for the audio resource. This is good for long sounds, as it uses less memory and avoids CPU spikes on load, but decoding will use more CPU resources during playback. Play: * Plays the sound in the editor. Volume: * Sets the default volume for the sound (from 0.0 to 1.0). ++++++++++ Sound Scripting ++++++++++ This is a simple example of how to request and play sound assets in code:: let soundId = request_sound("my_sound.wav") play_sound(soundId)