SamiPerttu / fundsp

Library for audio processing and synthesis
Apache License 2.0
808 stars 44 forks source link

Make `Wave::load_slice` more flexible #61

Closed tomaka closed 3 weeks ago

tomaka commented 3 weeks ago

At the moment, decoding an audio file into a Wave can only be done from either a filesystem path or a &'static [u8]. This makes it impossible to provide, for example, data downloaded from a socket (unless you first save it to disk).

Looking at the implementation, this seems unnecessarily restrictive, so I modified it to accept any AsRef<[u8]>. This makes it possible to pass a Vec<u8> for example.

SamiPerttu commented 3 weeks ago

Thanks for the improvement!