Module sound
Available on crate feature
dep_kira
only.Expand description
Sources of audio.
Any type that implements SoundData
can be played using
AudioManager::play
. Kira comes with two
SoundData
implementations:
StaticSoundData
, which loads an entire chunk of audio into memory. This is more appropriate for short sounds, sounds you want to play multiple times, or sounds where consistent start times are important.StreamingSoundData
, which streams audio from a file or cursor (only available on desktop platforms). This is more appropriate for long sounds that you only play once at a time, like background music. Streaming sounds use less memory than static sounds.
These two sound types should cover most use cases, but if you need something else, you can
create your own types that implement the SoundData
and Sound
traits.
Modules§
- Playable chunks of audio that are loaded into memory all at once.
- Decodes data gradually from an audio file.
Structs§
- A portion of audio.
Enums§
- The ending time of a region of audio.
- Errors that can occur when loading or streaming an audio file.
- A point in time in a piece of audio.
- The playback state of a sound.
Traits§
- A trait for types that can be converted into an
Option<Region>
. - An actively playing sound.
- A source of audio that is loaded, but not yet playing.