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 it build for wasm32-unknown-unknown #7

Open
icefoxen opened this issue Jan 14, 2019 · 4 comments
Open

Make it build for wasm32-unknown-unknown #7

icefoxen opened this issue Jan 14, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@icefoxen
Copy link

With clang building the C parts of it, this should be possible, right? ...right?

The main blocker I hit was the slice_deque library, which uses Virtual Memory Tricks to give you a cheap ring buffer that's always linear. Webassembly doesn't have virtual memory, so you can't do that; see gnzlbg/slice_deque#60 for discussion.

So I was thinking the best solution would be to wrap the SliceDeque that this library uses in a type that presents the same API but does copying under the hood when necessary on platforms that slice_deque doesn't support. If you're willing I'll gladly contribute the changes.

Thanks so much!

@germangb
Copy link
Owner

germangb commented Jan 14, 2019

With clang building the C parts of it, this should be possible, right? ...right?

My knowledge of wasm is limited atm,

I think (might be completely wrong) minimp3 (the original C) would need to be built into a wasm module (I haven't checked if it is possible), then remove the ffi interface from this crate, and replace it with glue code to interoperate with the wasm module from Rust..

So I was thinking the best solution would be to wrap the SliceDeque

I'm not sure if the implementation belongs in this crate (we don't event have test. I need fix this someday). How about a fork with the changes you suggest in your issue?

@icefoxen
Copy link
Author

Sounds good to me, I'll try it out.

@Moxinilian
Copy link

Any progress on this front?

@germangb germangb added the enhancement New feature or request label Dec 5, 2020
@germangb
Copy link
Owner

Not from my side

As an experiment, maybe it would be worth trying to write wasm-bindgen bindings for this repo: https://github.com/bashi/minimp3-wasm (I just found out about it and haven't tried it myself)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants