Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: [C++] Playing a raw vorbis stream (Read 9886 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[C++] Playing a raw vorbis stream

Hello all and thank you in advance for any advice.

I am trying to put together a (linux) C++ application which will send/receive Vorbis audio over RTP.  The sender will read an OGG audio-only file and stream the vorbis data. On the receiver end I would like it to play the audio.  For information my linux platform is Ubuntu.

If any of the following is the wrong approach for this task then please do let me know I am open to learning the right way!

I have looked at RFC 5215 describing the RTP format for Vorbis Audio and tat seems to make sense (I hope).  As I understand it the OGG page headers etc are redundant in the RTP stream and so are not sent.  Only the Vorbis headers are sent.  To that end I have written a simple parser which currently extracts all of the vorbis packets into a buffer.  This bufer now contains all the packets from the file including the Identification, Comment and setup headers but none of the OGG information.  I expect audio sample rate data etc will be sent in SDP messages accompanying the RTP.

I (hope) that this buffer would now be split into the rtp packets and sent.  I am happy to work on this part (The RTP packetising) myself. 

What I want to do first however is test the data in my buffer but I can't find a direct reference of how to play vorbis audio from memory without OGG encapsulation?  Can anybody advise me of the best way to do this?

Thank you in advance, if I've been unclear at all or if you would like more information please feel free to ask!