Convert wav to ogg on app engine (or in javascript?)
Asked Answered
R

2

1

I've built a little app engine app that lets users upload short recordings. Some of the recordings are done in-browser with https://github.com/mattdiamond/Recorderjs, which creates wav files. To save space, I'd like to convert those to ogg before writing them to the app engine datastore, so that I use less of my outgoing bandwidth when I play the audio recordings back to users.

How can I do this? I googled around, and apparently there's a command line tool called oggenc that encodes to ogg -- but I'm pretty sure I can't install that (or, even if I could install it, make calls to it) on app engine.

I found a similar question at Encode audio from getUserMedia() to a .OGG in JavaScript -- this links to https://github.com/jpemartins/speex.js, a project that looks like it might eventually be able to convert from wav to ogg in javascript (which would be great), but, as far as I can tell, does not do so at the moment. At https://github.com/jpemartins/speex.js/issues/4 the authors mentions that WAV -> ... -> OGG is not yet possible.

What else should I try?

Edit: My app engine code is written in Python, so another possibility would be to do the conversion there, with a python module that can convert wav to ogg. I think http://pymedia.org/ can do this, but I'd have to somehow install it on app engine -- is that possible?

Ratal answered 6/7, 2013 at 22:51 Comment(0)
P
2

Pymedia isn't pure python so you won't be able to use it on app engine.

You probably want to build something on Compute Engine to do this.

Pardo answered 7/7, 2013 at 4:11 Comment(1)
Thank you, I didn't know about Compute Engine. If I understand correctly, I could build a service that receives WAVs, calls e.g. oggenc and spits back oggs. That said, I would ideally find a way to do this for free and without sending so much data back and forth. I found a similar question at #17457529 -- would be great to be able to do this in javascript.Ratal
G
1

Provided it's possible to replace Matt Diamond's recorderjs with its fork, chris-rudmin/Recorderjs (demo page) in AppEngine, this should be feasible. Or first encode to WAV and use opusenc.js (demo page), which is an Emscripten port of the Opusenc tool, to convert a temporary WAV file to Ogg-Opus client side.

Goldofpleasure answered 11/3, 2015 at 12:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.