From d96b32d1a4496c701f94b40ff745e273699e66fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20du=20Garreau?= Date: Mon, 17 Aug 2026 00:23:25 +0200 Subject: [PATCH] Enable using non-`'static` data in `StaticSoundData` Symphonia no longer restricts the lifetime of the decoder, so we can now enable using data with a lifetime here. And yes this is a weird title. --- crates/kira/src/sound/static_sound/data/from_file.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/kira/src/sound/static_sound/data/from_file.rs b/crates/kira/src/sound/static_sound/data/from_file.rs index e2736df8..045083bf 100644 --- a/crates/kira/src/sound/static_sound/data/from_file.rs +++ b/crates/kira/src/sound/static_sound/data/from_file.rs @@ -19,7 +19,7 @@ impl StaticSoundData { /// Loads a cursor wrapping audio file data into a [`StaticSoundData`]. #[cfg_attr(docsrs, doc(cfg(feature = "symphonia")))] - pub fn from_cursor + Send + Sync + 'static>( + pub fn from_cursor + Send + Sync>( cursor: Cursor, ) -> Result { Self::from_media_source(cursor) @@ -28,13 +28,13 @@ impl StaticSoundData { /// Loads an audio file from a type that implements Symphonia's [`MediaSource`] /// trait. #[cfg_attr(docsrs, doc(cfg(feature = "symphonia")))] - pub fn from_media_source( - media_source: impl MediaSource + 'static, - ) -> Result { + pub fn from_media_source(media_source: impl MediaSource) -> Result { Self::from_boxed_media_source(Box::new(media_source)) } - fn from_boxed_media_source(media_source: Box) -> Result { + fn from_boxed_media_source( + media_source: Box, + ) -> Result { let codecs = symphonia::default::get_codecs(); let probe = symphonia::default::get_probe(); let mss = MediaSourceStream::new(media_source, Default::default());