Recommended Posts

Sry if this has already been posted about but I searched and could not find any posts about it. I also checked numerous websites out and ran many google searches with no results. I am a High School Intern and my project involves making and running an AVI file in openGL among other things. NeHe does not explain how to get sound to play in his tutorial. I found out how to play sounds in .WAV files, but not AVI files. So if anyone can help me out i would greatly appreciate it.
Thank you

Share this post

Link to post

Share on other sites

All he does in the tutorial is play the video, he does not play sound. He takes the frames from the video and textures them, he does nothing to mess with the sound. I need to play the video and audio but I know no ways of playing sound from an AVI file.

Share this post

Link to post

Share on other sites

I can't believe I didn't think of this before posting my first link. This is probably the best and the easiest way to play avi files with sound. Just remember that you'll need to link winmm.lib and vfw32.lib with your compiler.

0

Share this post

Link to post

Share on other sites

I read through the file and i downloaded the samples and got them to compile, it plays video fine, but not audio. I went back and looked through the code and it does not get the audio format nor process the audio. (AVITest sample, not the AVIDemo sample, the avidemo throws an error in windows then i run the application that came with it.)

I been trying to modify the code a little but to play the audio, but I cannot get it to work yet, i switched AVI files making it play one of my own that i know has sound. still no sound.

I used LPWAVEFORMAT pAudioFormat = g_AviFile.GetAudioFormat(0); to get the format of the audio, that compiles fine, but i am not sure how to process and play the audio.

Share this post

Link to post

Share on other sites

Use directshow.You could easily (if you're already familiarized with directshow) build a custom video renderer that feeds the video data to a texture.If you only want to render the audio then you just create the source filter and the audio renderer and call IGraphBuilder::Connect to "inteligently" connect the two filters, then you just run the graph and that's it.