Jonas B's picture

Status of ogg?

I see in the archives that ogg vorbis support is / has been under development (50% complete at some point) - but I can't find any references to it in the source, or further notes on the development.

Is it available? If not, is there an ETA? Do you need coding help? If so, where's the source?



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

There are no plans to add ogg support at this time. The closest thing to a managed implementation is the old (but recently resurrected) csvorbis project.

The only alternative is to look for a libvorbis wrapper (there are several). Otherwise, cooking up a new decoder is not a task for the faint-hearted.

Jonas B's picture

Thanks - I'm checking with Atsushi if he needs help with csvorbis.
I have my own P/Invoke-based wrapper since earlier projects, but that won't work in mono I guess. Is there a particular mono-based wrappers you'd recommend?

the Fiddler's picture

Assuming the libvorbis API is the same on all platforms (and why should it not be?), your wrapper should work with Mono without any changes. You simply have to create a dll.config file that maps the correct library name for the DllImports (e.g. vorbis.dll ->

Also, consider uploading the wrapper to the database. Ogg decoding is universally useful and your wrapper will receive much more testing this way.

That said, an improved csvorbis would be a boon for the whole .Net community. The library actually works, but it's rather slow and its interface is a bit ugly (it was translated from java using a tool, AFAIK).

Jonas B's picture

Huh, didn't know about P/Invoke mapping - cool! Will try it out. The current wrapper is just a variant of, customized to fit with my old framework's plugin API.

I'll play around with it and post something when it's working - ATM I can't get sound at all in Linux though (missing openal32.dll problem as per another thread).

[Edit: link didn't show up]

Jonas B's picture

Had some time to look at the details - the CodeProject program uses an additional C-based wrapper between C# and vorbis, so I need to port that to C# (not sure how difficult it would be).

I notice it uses 3 different libraries (ogg_static.lib, vorbis_static.lib and vorbisfile_static.lib) - I guess that means I need more than only libvorbis on Linux..?

the Fiddler's picture

Skimming through the article, it seems that the C-based wrapper is not strictly necessary and it's functionality could be replicated in C#. I'm pretty sure Linux distros ship with all necessary libraries for ogg playback - I don't know what the difference between ogg_static.lib, vorbis_static.lib and vorbisfile_static.lib is, but I guess all of these are available with similar names (as dynamic libraries).