Finally I decided to use stb_vorbis(https://github.com/nothings/stb), it's only 5k lines of code and very easy to use. I implemented streaming music playback with stb_vorbis, and it works well for me. :)
Thank you very much. 在 2018年3月8日星期四 UTC+8上午12:30:02,jj写道: > > If you mean WebAudio's .decodeAudioData(), then you could use it > manually via routing from JS to OpenAL, e.g. by contributing an > extension to the OpenAL JS audio library do that (I think native > OpenAL side has extensions that allow passing in compresssed audio > buffers). > > One note though is that use of .decodeAudioData() API is definitely > recommended for only very short audio clips, since that API only has > the possibility to decode the whole audio clip in full, which means > the memory usage will easily blow up on the orders of 100s of MBs for > music clips, and take up 20 seconds+ worth a 100% CPU core when run on > mobile devices on ~5 minutes long files. Implementing an on the fly > streaming solution is a necessity when implementing music playback. > For short audio clips though, the decode up front route sounds > feasible. > > 2018-03-07 17:47 GMT+02:00 Joshua Astray <joshua.a...@gmail.com > <javascript:>>: > > Can we use browser's built-in decoder for OpenAL? > > > > I can find some test code that use .ogg file with SDL audio, and I think > it > > should be compiled with --use-preload-plugin so that browser will decode > the > > .ogg files. > > > > But how can we use .ogg files with OpenAL? I dont want to import the > > libvorbis/libogg if possible, because that will increase the size of > > compiled file. > > > > Thank you for any help. > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "emscripten-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to emscripten-discuss+unsubscr...@googlegroups.com <javascript:>. > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.