I would like to seek help from you,
I have implemented both OgreOgg and OgreTheora well, I have succeeded playing movie in my application, but I have a problem producing the sound from the movie.
From the documentation of OgreTheora, OgreTheora will call this listener function:
//! A function that the TheoraVideoClip object calls once more audio packets are decoded
\param data contains one or two channels of float PCM data in the range [-1,1]
\param nSamples contains the number of samples that the data parameter contains in each channel
virtual void insertData(float** data,int nSamples)=0;
every frame if i am not mistaken.
The problem is, with just a pair of float** and int, how I can play this sound? Can I use OgreOgg to play this?
Thank you stickymango for your help!
Nb. I posted this message in OgreOgg forum not in Theora forum because I think the Theora's author (Kreso) have made the interface to play the sound with above function, and how the sound is being played is up to the user.
Take a look at this file: http://libtheoraplayer.svn.sourceforge
. ... p?view=log
there you'll find an example how to use the ogre video plugin's PCM data for playback via OpenAL. I'm not sure what OgreOGGSound uses for playback, but since you have PCM data from the playing video, it should be easy enough to implement.
At present there is no method to pipe raw audio data into or extract out of an OgreOggSound sound, so you would have to handle this yourself using OpenAL directly. At present OgreOggSound doesn't support float format PCM sounds.
I checked ogreoggsound a bit and indeed it uses OpenAL. so as far as ogre theora is concerned, you can use the stock openal interface to pipe sound
Thanks for your help Kreso and StickyMango.
I tried to make a new class that implements OgreOggISound and Theora's Audio stream, but I stucked
, I think my skill in OpenAL is very low so I got confused much
Then my solution is: I will use the Theora's sample implementation of decoding sound, side by side with OgreOgg then. I hope both of them are not conflicting each other.
It should work okay. the audio interface uses one source only, unless OgreOggSound uses all available sources, it should be ok.
That should be fine, OgreOggSound uses sources as and when it needs them.
Kreso and Stickymango,
I have implemented both the OgreOgg and the Audio Interface side by side, and everything's working very well. Thank you very much for all of your help.