diff --git a/src/read.rs b/src/read.rs index cdb8303..f4c68a0 100644 --- a/src/read.rs +++ b/src/read.rs @@ -26,14 +26,17 @@ impl Wave { /// Load first track of audio from the given slice. /// Supported formats are anything that Symphonia can read. - pub fn load_slice(slice: &'static [u8]) -> WaveResult { + pub fn load_slice + Send + Sync + 'static>(slice: S) -> WaveResult { Wave::load_slice_track(slice, None) } /// Load audio from the given slice. Track can be optionally selected. /// If not selected, the first track with a known codec will be loaded. /// Supported formats are anything that Symphonia can read. - pub fn load_slice_track(slice: &'static [u8], track: Option) -> WaveResult { + pub fn load_slice_track + Send + Sync + 'static>( + slice: S, + track: Option, + ) -> WaveResult { let hint = Hint::new(); let source: Box = Box::new(Cursor::new(slice)); Wave::decode(source, track, hint)