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?

Community
  • 1
  • 1
Adrian
  • 3,138
  • 2
  • 28
  • 39

2 Answers2

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.

dragonx
  • 14,963
  • 27
  • 44
  • 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 http://stackoverflow.com/questions/17457029/converting-wav-to-any-compressed-audio-format-in-client-side-javascript -- would be great to be able to do this in javascript. – Adrian Jul 08 '13 at 01:14
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.

Rainer Rillke
  • 1,281
  • 12
  • 24