From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Allegro3.0 and play_sample() problem Date: Wed, 11 Feb 1998 19:17:17 +0000 Organization: None Distribution: world Message-ID: References: <34E1B376 DOT 581C AT post DOT comstar DOT ru> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 30 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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