Mail Archives: djgpp/1998/06/16/23:48:02
From: | a DOT gillett AT virgin DOT net (Andrew R. Gillett)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Allegro: Voice being cut off
|
Date: | Mon, 15 Jun 1998 23:45:12 +0100
|
Organization: | Virgin Net Usenet Service
|
Lines: | 36
|
Message-ID: | <MPG.fee8a0d585c5fb898978e@news.virgin.net>
|
NNTP-Posting-Host: | 194.168.62.34
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
The music of my game is stored as a number of large samples. These are
played using the voice allocation commands, and the priority is set to
255.
However, if I play a lot of other samples (using play_sample) at the same
time, the music is sometimes cut off. When I say a lot at the same time,
I mean many simultaneous samples, maybe twenty or more. Of course, there
are not this many voices available, but I want the new samples to be cut
off, not the music.
The music, btw, is in three stages. When one stage is finished, the next
stage is started using reallocate_voice. Here is the bit of code which
does it:
if (musictype <= 0)
reallocate_voice (music_voice, (SAMPLE *)musicfile[ZOO_SHRINK].dat);
else
reallocate_voice (music_voice, (SAMPLE *)musicfile[DLD_SHRINK].dat);
voice_set_priority (music_voice, 255);
voice_set_playmode (music_voice, PLAYMODE_LOOP);
voice_start (music_voice);
I don't know, maybe I have to set the priority AFTER calling voice_start.
Or maybe the priority doesn't work....?
Btw, this only seems to happen on the second (interlude) music. The only
difference I can see is that, unlike the other parts of the music, this
part does not loop, it just plays once. Also, the final stage of the
game/music will only start when the interlude music has finished. If the
interlude music is cut off, the game will not end properly :(
--
Andrew Gillett
http://argnet.fatal-design.com/
ICQ: 12142937
- Raw text -