Archived

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

sounds happen -1 step?

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

okie, i have 2 wav files. wave 1 is to be played during menu time. wave 2 is to be played during main game time. considering that menu time is during game_main, how come i have to put wave 1 during game_init, so that it can be played during menu_time? same goes for wave 2, i have to put in menu time, so that it can be played during main game time.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Put it in? You mean start playing?

Share this post


Link to post
Share on other sites
ok a clearer example>

game_init()
{

game_state = GAME_STATE_INIT;
if(game_state == GAME_STATE_INIT)
{
..
}

DSoundPlay("wave1.wav");
//if menu music is to be heard, why i have to put here?

//last line
game_state = GAME_STATE_MENU;

}//end game_init


game_main()
{

if(game_state == GAME_STATE_MENU)
{
..
DSoundPlay("wave2.wav");
//if main game music is to be heard, why i have to put here?
//considering that GAME_STATE_RUN is not yet called!

}

game_state = GAME_STATE_RUN;
...
}//end game_main

[edited by - edwinnie on May 3, 2002 11:01:53 AM]

Share this post


Link to post
Share on other sites
Do you continually tell it to play? You should probably only tell it to play when the game is done loading, and end it. Or do a check to see if it isn''t playing, and play it (if wanted). I don''t know if this is your problem.


Would telling a wav to play over, and over , make it restart? It may, but i''ve never done this. If it does then would you hear it? I will answere my own question, it probably depends (right?), but you keep (possibly) restarting the wav and when you leave Init or Menu then it isn''t being restarted anymore, so it plays through.. make sense? I think it does, but I''m not the brightest something or other in a group or similar.

Share this post


Link to post
Share on other sites