Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Wave::load_slice more flexible #61

Merged
merged 1 commit into from
Nov 3, 2024

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Nov 3, 2024

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
Copy link
Owner

Thanks for the improvement!

@SamiPerttu SamiPerttu merged commit 801ad0a into SamiPerttu:master Nov 3, 2024
3 checks passed
@tomaka tomaka deleted the wave-load-better branch November 3, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants