Mail Archives: djgpp/1998/02/12/00:25:08
Dim Zegebart writes:
>kbd_handler()
>{ if (KEY_P)
> play_sample(samp1,...,1); // plays OK
> else
> stop_sample(samp1); // I can press P-any_key keys as much times as I
>want and it works fine. But ... (see foo())
>}
>
>foo()
>{ if (some_cond)
> play_sample(samp1,...,0); //the same global sample. (Doesn't work at
>all)
>}
Are these function really both using the same sample? If so, whenever
you trigger it from the foo() routine, on the next call to kbd_handler()
it will be turned off again by the stop_sample() call, so it will never
get a chance to play. If you need to overlap looping and triggered
versions of the same sample, it would be better to use the voice_*()
family of functions rather than the play_sample() routine.
If these samples are in fact different, I don't know what the problem
could be, but if you can narrow it down to something smallish that I can
actually compile, I will be very happy to look at it...
--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
"Pigs use it for a tambourine" - Frank Zappa
- Raw text -