Use NVorbis to encode WAV to Ogg?

Aug 17, 2013 at 5:17 PM
Hi, great project.

Is it possible to use this code to encode a wav file to ogg?

A quick search of the project didn't turn up encoding methods - but it still looked promising as a starting point.
Aug 17, 2013 at 11:35 PM
Thank you for taking a look. However, encoding is well beyond the scope of this project.

What is the scenario you are trying to handle? I might have some advice...
Aug 18, 2013 at 5:57 PM
Basically, I'd like to be able to encode an ogg file in c#. Ideally, this would happen on the fly from the raw audio data, but writing first to a .wav file and then running a conversion would be fine.

My current thinking is to use pinvoke, but this could get tricky since the ogg libs have a lot of custom structs that would need wrapping...

Any thoughts are welcome!
Aug 18, 2013 at 10:19 PM
No matter how you go about it, you'll have to require full trust for your app. That may not be an issue. :)

If you can afford the performance hit and disk space usage, just use an external encoder. It's far simpler. Otherwise, you'll have to pinvoke the libraries directly. I think there may be a few wrappers available to make that easier (I've seen them in Google searches, but don't know of one in particular offhand).

While I'm at it, allow me to recommend a couple encoder options: 1) aoTuV is probably the highest quality available for Vorbis, 2) Lancer is an optimized version. I think there's a lancer build for aoTuV, but don't remember for sure.

Good luck!