diff --git a/crates/bevy_audio/src/audio.rs b/crates/bevy_audio/src/audio.rs index 7c020a0333..89bd186e1a 100644 --- a/crates/bevy_audio/src/audio.rs +++ b/crates/bevy_audio/src/audio.rs @@ -36,6 +36,12 @@ impl Volume { #[derive(Debug, Clone, Copy, Reflect)] pub enum PlaybackMode { /// Play the sound once. Do nothing when it ends. + /// + /// Note: It is not possible to reuse an `AudioPlayer` after it has finished playing and + /// the underlying `AudioSink` or `SpatialAudioSink` has been drained. + /// + /// To replay a sound, the audio components provided by `AudioPlayer` must be removed and + /// added again. Once, /// Repeat the sound forever. Loop, @@ -77,13 +83,18 @@ pub struct PlaybackSettings { impl Default for PlaybackSettings { fn default() -> Self { - // TODO: what should the default be: ONCE/DESPAWN/REMOVE? Self::ONCE } } impl PlaybackSettings { /// Will play the associated audio source once. + /// + /// Note: It is not possible to reuse an `AudioPlayer` after it has finished playing and + /// the underlying `AudioSink` or `SpatialAudioSink` has been drained. + /// + /// To replay a sound, the audio components provided by `AudioPlayer` must be removed and + /// added again. pub const ONCE: PlaybackSettings = PlaybackSettings { mode: PlaybackMode::Once, volume: Volume(1.0),