Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Xiachunyi

Cueing with music

This topic is 5559 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

Hello, is there anyway to cue your OpenGL graphics with music? I have tried to place a counter within the program to keep track of how many frams have passed before an execution, but sometimes the execution is too fast or too slow. Example:
  
int DrawGLScene()
{
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//The starting screen

  if(screen == -1)
  {
    if(startup_snd == 0)
    {
//       Sleep(5000);

       PlaySound("intro.wav", NULL, SND_FILENAME | SND_ASYNC);       
       startup_snd=1;
    } 
    startscene(); //Start scene is a function so I won''t have to go through the stuff once I''m done.

    if(fade < 1.0)
    {
       fade=fade+0.001;
    }
    if(fade > 1.0)
    {
      cue=cue+0.001;
    }
    if(cue > 4.0)
    {  
       screen=0;
    }      
  }
  
This is fairly dependable but once in a while, it skews off to fast or too slow.

Share this post


Link to post
Share on other sites
Advertisement
You do know this is an OpenGL forum, Graphics API....

That is absolutley out of subject.
But then egain, it does have a little....

Have you ever thought of looking into Multi Threaded Programs...
There are definatley other solutions, but this is the only one that comes ot mind atm.

[edited by - Smokey97 on April 1, 2003 2:49:21 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Take a look at the FMOD audio library. It supports an wav format that can embed audio cues.

Share this post


Link to post
Share on other sites
quote:

You do know this is an OpenGL forum, Graphics API....

That is absolutley out of subject.



How is it absolutly out of the subject? Don''t games have synced cinematic sequences that weren''t pre-recorded? If you wanted to have a game make a sound after some point of activation and change to another pitch while activating another command, wouldn''t you want it to be synchronized?!? Not resulting in a two second delay either way because your computer was doing something at the moment or somewhat.

Share this post


Link to post
Share on other sites
the way to do it is to keep track of the time, not the frames.
It''s pretty simple to write your own class that can keep track of time, and timebased movements (instead of framebased) makes the program run the same on another computer

Share this post


Link to post
Share on other sites
How is it absolutly out of the subject? Don''t games have synced cinematic sequences that weren''t pre-recorded?


It is out of the subject because this is a Graphics API forum, not a game dev forum...

But i''m not a moderator (yet :evil grin so dont listen to me.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!