<html><head></head><body>The last time I had I decode ogg the source code of oggdec did nearly read like documentation. If I remember it right it basically ran a batch of initialization functions from libogg and libvorbis (the first three packets are the header containing the info that the file uses the vorbis codec, the metadata and everything the vorbis codec needs to know in order to to decode the data; Libogg's task is to divide the steam into packets). After the decoder has been informed about the header it can decide any packet libogg will output. You can even leave out any number of packets or throw in a "end-of-file" packet followed by a new header at any time.<br>
<br>
If you write the encoder as well there is one thing I would ask you to ask: there is a so-called granulepos field in every packet telling how much time has passed since the beginning of the steam to help with seeking. The unit this information is given in is basically irrelevant. It might be milliseconds, samples or something similar. But it has to steadily increase all the time or else some players will crash - or get lost when attempting to seek in the steam.<br>
<br>
Kind regards<br>
<br>
Gunter.<br><br><div class="gmail_quote"><br>
<br>
Andy Martin <zippo227@gmail.com> schrieb:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">I would like to program a basic OGG decoder that takes in an array of <br />bytes (unsigned char *) and return an array of floats. Presumably I <br />could then pass these floats to be read as PCM data which can be <br />immediately interpreted as audio (by Unity3D). The starting point would <br />be the header of an icecast stream (I know I'm not in the icecast <br />mailing-list, but that is only the basic starting point). From then on, <br />I would be dumping raw ogg bytes into this function and returning <br />floats. I am working in the games industry using C++ and C# every day, <br />but I have less experience than I would like using open-source libraries.<br /><br />Presently, I can get a continuous stream of bytes of OGG from an <br />asynchronous HttpWebRequest through C#. I want to pass those bytes into <br />the function that I'm describing. Shouldn't I be able to pass any random <br />sequence of bytes into this function and get some kind of float pattern <br />that can be read as PCM (thought it may sound awful if it is truly a <br />random array of bytes)?<br /><br />For those interested, my starting point is a Windows8 machine with <br />Visual Studio, but I would eventually like to port the project to XCode.<br /><br />As I read the Vorbis documentation, I find it very difficult to find a <br />place to start. What are the significant traits of the important <br />libraries, ogg and vorbis, and how do they work together? What are the <br />steps I need to follow, and where can I get more information than the <br />documentation has? I probably just need to chat with someone who really <br />knows what they're doing, but, the people I know used JUCE. They've used <br />the JUCE library to do something like this, but I would like to do a <br />straight-forward use of the open-source XIPH libraries. There are many <br />warnings about not using the low-level API, and most of the links on <br /><a href="http://xiph.org">xiph.org</a> are for pre-existing ogg players instead of source code for <br />making your own player.<br /><br />I really appreciate any help and am open to get on the group chat at <br />some point.<br /><hr /><br />Vorbis-dev mailing list<br />Vorbis-dev@xiph.org<br /><a href="http://lists.xiph.org/mailman/listinfo/vorbis-dev">http://lists.xiph.org/mailman/listinfo/vorbis-dev</a><br /></pre></blockquote></div><br>
-- <br>
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.</body></html>