[Vorbis-dev] decoding vorbis bytes into floats

Andy Martin zippo227 at gmail.com
Wed Oct 2 23:38:04 PDT 2013


I would like to program a basic OGG decoder that takes in an array of 
bytes (unsigned char *) and return an array of floats. Presumably I 
could then pass these floats to be read as PCM data which can be 
immediately interpreted as audio (by Unity3D). The starting point would 
be the header of an icecast stream (I know I'm not in the icecast 
mailing-list, but that is only the basic starting point). From then on, 
I would be dumping raw ogg bytes into this function and returning 
floats. I am working in the games industry using C++ and C# every day, 
but I have less experience than I would like using open-source libraries.

Presently, I can get a continuous stream of bytes of OGG from an 
asynchronous HttpWebRequest through C#. I want to pass those bytes into 
the function that I'm describing. Shouldn't I be able to pass any random 
sequence of bytes into this function and get some kind of float pattern 
that can be read as PCM (thought it may sound awful if it is truly a 
random array of bytes)?

For those interested, my starting point is a Windows8 machine with 
Visual Studio, but I would eventually like to port the project to XCode.

As I read the Vorbis documentation, I find it very difficult to find a 
place to start. What are the significant traits of the important 
libraries, ogg and vorbis, and how do they work together? What are the 
steps I need to follow, and where can I get more information than the 
documentation has? I probably just need to chat with someone who really 
knows what they're doing, but, the people I know used JUCE. They've used 
the JUCE library to do something like this, but I would like to do a 
straight-forward use of the open-source XIPH libraries.  There are many 
warnings about not using the low-level API, and most of the links on 
xiph.org are for pre-existing ogg players instead of source code for 
making your own player.

I really appreciate any help and am open to get on the group chat at 
some point.


More information about the Vorbis-dev mailing list