libopus compile good, but help using encode function w/ getUserMedia?

93 views
Skip to first unread message

Mahesh Kommareddi

unread,
Sep 12, 2015, 2:20:13 PM9/12/15
to emscripten-discuss
Hi all,
 I tried the IRC, but I'm hoping I can get some help here as well. I'm basically brand new to emscripten. I'm trying to learn/get libopus to work in the browser. I'm interested in both encode + decoding in the browser.

I think I got everything compiled correctly. A gist of the emconfigure, emmake:
https://gist.github.com/mkommar/9f51db6a2da114a5dab4

1) Do I compile the .a file or the .so file?
emcc libopus.so -o libopusa.html -s EXPORTED_FUNCTIONS="['_opus_encoder_create', '_opus_encoder_ctl', '_opus_encode', '_opus_encode_float', '_opus_encoder_destroy', '_opus_decoder_create', '_opus_decode', '_opus_decode_float', '_opus_decoder_destroy', '_encode_buffer', '_opus_strerror']" -s RESERVED_FUNCTION_POINTERS=1

If I compile the .so file, I can init the proper encoders and decoders and run the opus_ecnoder_ctl for the encoder.

https://gist.github.com/mkommar/e32977f6a2502c87bd47

but I can't seem to understand how to actually use the opus_encode (pointers, stackmax, etc) as working with the library by sending data to the function seems to escape me .

Can anyone help or is there anyone I can get referred to?

Alon Zakai

unread,
Sep 12, 2015, 8:24:59 PM9/12/15
to emscripten-discuss
See the example with malloc for passing a pointer to allocated memory, etc., which you'll probably need if opus_encode receives pointers.


--
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-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mahesh Kommareddi

unread,
Sep 12, 2015, 11:07:01 PM9/12/15
to emscripte...@googlegroups.com
Thanks for the help.

Very helpful. I'm woefully needing help through my first foray and found this GitHub repo to guide me through things and it echos your insight.

Really appreciate the help.

Mahesh

--
You received this message because you are subscribed to a topic in the Google Groups "emscripten-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/emscripten-discuss/UoApO89N_YE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to emscripten-disc...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages