Comments (23)
This fork of Lyra supports a WebAssembly build. Here is a demo of Lyra running on the web based on that.
from lyra.
Just FYI, but I released a WebAssembly build of Lyra: https://github.com/shiguredo/lyra-wasm
(Note that descriptions are written in Japanese)
During the development, it turned out Lyra can be built into WebAssembly without any patches.
Visit https://github.com/shiguredo/lyra-wasm/tree/develop/wasm for the detail.
Lastly, thank you for developing and publishing this great audio codec library!
from lyra.
@josephrocca - Sure things. My rough idea is to use macro to exclude out all glog
module and see if there is anything else would break the compilation. If you wanna work together, it will be fantastic. I have a workable bazel config for compiling everything to wasm target.
from lyra.
#ifdef __EMSCRIPTEN__
#include <iostream>
#define LOG(STATUS) std::cout << STATUS << ": "
#define VLOG(STATUS) std::cout << STATUS << ": "
#define ERROR "error"
#define INFO "info"
#define WARNING "warning"
#define FATAL "fatal"
#endif
For MVP, I think we could add some code like this to replace log with plain cout.
I believe this will work and will test it out later today.
from lyra.
@josephrocca - Humm, that's sound like a good way of workaround, I will try to implement it this weekend.
from lyra.
Thanks for creating and sharing that @sile! I've linked to your repo from here: https://github.com/josephrocca/lyra-v2-soundstream-web That was my in-progress attempt to get LyraV2 working with TFjs-TFLite and ONNX Runtime Web, but looks like I can stop pushing on that now that you've released your Emscripten port! ❤️
from lyra.
This is very cool, thanks for sharing @sile. It's great to have a Lyra V2 wasm support with a demo.
from lyra.
That is a great idea!
from lyra.
After brief research, I think the glog will block the wasm export.
Since glog does not support exporting for WASM target.
from lyra.
@WenheLI @aluebs Is there any way I can help to get a proof-of-concept wasm build working? I unfortunately don't have much experience with Bazel since I come from the web side of things, but I'm happy to learn as much as is needed to help here. Given the aformentioned glog obstacle, can I ask what the high-level steps are likely to be to get a wasm build working?
from lyra.
Contributions are always welcomed. And having a wasm Lyra target would be fantastic! :)
from lyra.
Thank you @WenheLI for looking into it.
And hopefully we can find a workaround.
from lyra.
@aluebs - Thanks. Just wondering if the glog / logging matters in production?
One simple workaround would be to use some macros to protect it (and even replace glog with some wasm compatible logging) while building for wasm.
And I think let the glog support wasm would be a quite large scope and may not be feasible.
from lyra.
The logging level for production is something that should be left to the owners of the project that integrates Lyra. But it would be fantastic to use macros to differentiate a wasm build (using compatible logging) from a non-wasm build (using glog).
from lyra.
@WenheLI Sounds great! 🎉 Please do let me know how the test went and how I can be helpful here.
from lyra.
I think we should still need to deal with glog
since other deps are still using it which will block our compilation.
from lyra.
@WenheLI Hmm. Is it possible/feasible with C++/Bazel to do a sort of "rewrite" of package resolution/import at the top level Bazel config file (for the wasm build) such that it all sub-packages and external packages see a fake/dummy version of glog which proxies all function calls to a no-op (at least for MVP)? In JS I'd just import a dummy module that uses a Proxy, but I have no idea if this sort of thing is possible with C++/Bazel.
from lyra.
@WenheLI Any luck with this? If you don't have time, would you be able to share your changes in a github fork? I can pick up the reigns and see if I can make some progress :)
from lyra.
@josephrocca - Hi, Joe. Sorry it is kinda busy recently. I will definitely share a fork with you so that we could work together. Just give me a couple of days to organize the code!
from lyra.
@WenheLI No problem! :)
from lyra.
Hi, we are interested in trying this out, pls let me know if any thing is available to build up on. The issue is not updated since june. Thanks
from lyra.
Hi there, we are also interested in a wasm build, especially for the encoder part. Any update would be appreciated :)
from lyra.
This is amazing! Thank you, @mayitayew, for putting this together :)
from lyra.
Related Issues (20)
- Is there any plan to make this lib work on older android devices? HOT 2
- Linux build HOT 1
- ANDROID BUILD HOT 1
- Can't load TFLite output_details for quantizer model (encode) HOT 3
- When will lyra support ios platform? HOT 1
- The decoding CPU is too high. Is there any way to reduce it?
- model structure of lyra 1.3.2
- About crash problem with kInternalSampleRateHz set to 32k
- Android app built as per readme crashes (on Samsung S23) HOT 1
- how to read the encoded data in the sample1_16kHz.lyra file into python/numpy array?
- Directly provide the executable download address HOT 3
- Is that possible to release the model coeffs with codebook size=1024?
- Is it possible to still run the V1 model with the latest API? Or only V2
- LMCodec HOT 2
- Build fails on MacOS due to bad Tensorflow link HOT 1
- Noise is being added to generated speech in Python E2E flow (TFLite Models) HOT 2
- The Lyra Parameters
- bazel build -c opt lyra/cli_example:encoder_main
- support of sdk 34 and ndk
- Why does the sampling result need to be multiplied by 256?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lyra.