jpemartins / speex.js

Speex codec in Javascript. Mirror from https://code.ua.pt/projects/speex-js
214 stars 63 forks source link

Wideband Support? #2

Closed akumpf closed 10 years ago

akumpf commented 11 years ago

@jpemartins , It's not clear from the description if the Speex.js library supports Wideband Modes (mode=1,mode=2) of the Speex codec.

In testing, it seems to encode in wideband modes without error, but upon trying to play the speex-encoded audio back, it errors indicating that it finds more than two wideband channels.

Does speex.js support wideband? If not, what would it take?

Otherwise, does anyone know of any other javascript audio encoder libraries that might be a better fit for richer audio signals?

Cheers, Adam

jpemartins commented 11 years ago

Unfortunately, I didn't test for Wideband modes. At the time I developed this it was designed for VoIP application, so I tested only with narrowband mode.

Most likely, some silly mistake of mine in frame/buffer sizes. In the worst case is some misbehaving compilation with emscripten. I dont exactly know the effort of support Wideband, but could rather quick.

Encoders, as far as I know, its only my Speex or AMR and both of them for speech audio.

jpemartins commented 10 years ago

I just added support for Wideband mode (and hopefully Ultra Wideband, not tested though) here bb46d2f91b105fbf1426421818b38affed57f823. The issues were: parsing the Speex header, and not using OGG segments size to decode the stream. I tested it with samples ranging 17-21 Khz and everything was cool.

Check it out (the demo page) if you still interested :)

Cheers!