Playing audio from ogg/theora plugin


04-07-2010 17:42:41

I want to play the audio from an ogg/theora file (using the TheoraVideoPlugin). The plug-in provides audio support through a simple callback system with a "insertData(float **data, int nSamples)" method being called to periodically provide more audio data.

The problem is I can not see how to give this data to OgreAL. Is there some way to create an OgreAL sound without giving it a file (eg just telling it the number of channels and frequency) and then feed decoded PCM data to it later?


05-07-2010 09:48:51

This is not currently supported. If I have some free time over the next few weekends, I will look into this, but if it's too big, I may have to leave it for a holiday.


05-07-2010 12:20:46

Ok thanks.

I managed to implement something in OpenAL directly which seems to work alongside OgreAL (the only slight concern I have is that OgreAL may use all the available source buffers up so alGenSources fails) since I don't need 3D sound or anything for my video playback in this case.

There is an OpenAL sample in the plugin distribution which isn't too complex (I basically used this code to get something working) although I suspect integrating it into the existing OgreAL code base cleanly and in a generic way will be the hard bit.