Jump to content
  • Advertisement
Sign in to follow this  
BlackRyder

Playing multimedia

This topic is 4822 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i am looking for the best way to play multimedia in my game i am designing what someone here have a suggestion on playing AVI , and midi the avi should be played with sound that is why lesson 35 is not suitable and the midi is to be played in background and should not be affected by other sound effects thanks for the help BlackRyder

Share this post


Link to post
Share on other sites
Advertisement
something more simple????

i dont want to build right now a huge library... i mean it is really cool
the FMOD library it does alot of cool stuff but it is too complicated
i want something really easy... KIS type (Keep it simple :-) )

10x in advance

Share this post


Link to post
Share on other sites
FMOD is really super-easy to implement in a project, it just looks unduely complicated due to the huge array of things it can do. Here's a quick example of how to use it:

// include files
#include "./fmod.h"
#include "./fmod_errors.h"


/* initialise */

// initialise FMOD with 32 channels and 44100KHz
FSOUND_Init(44100, 32, 0);


/* stream */

// declare a stream
FSOUND_STREAM* stream;

// load stream
stream = FSOUND_Stream_Open("foo.ogg", 0, 0, 0);

// play stream
FSOUND_Stream_Play(FSOUND_FREE, stream);

// free stream
FSOUND_Stream_Close(stream);


/* sample */

// declare a sample
FSOUND_SAMPLE* sample;

// load sample
FSOUND_Sample_Load(FSOUND_FREE, "bar.wav", 0, 0, 0);

// play sample
FSOUND_PlaySound(FSOUND_FREE, sample);

// free sample
FSOUND_Sample_Free(sample);


/* de-initialise */

// kill FMOD
FSOUND_Close();



For MS Visual C++ you'll need to include 'fmodvc.lib' as well.

Hope that helped.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!