From: Murray B. <mb...@gm...> - 2001-01-30 17:18:15
|
>play_sample returns an int, which is a voice index. >voice_check(int) returns the sample currently playing on that voice. >check if it returns a pointer to the sample you want to play, and >play it again only if it's over (eg voice_check returns != your ptr) >or kill the previous one before starting a new one. That does not work. I tried following piece of code and it doesn't work; SAMPLE *shot; SAMPLE *active_sample = NULL; while (!game_over) { /* ... */ if ((mouse_b & 1) && (active_sample != shot)) { active_sample = voice_check(play_sample(shot, 255, 0, 22000, FALSE)); } /* ... */ } I will only hear sound when using the left mouse button for the first time... /Murray Bozinsky |