Mail Archives: djgpp/1999/02/19/10:54:04
Andrew Davidson writes:
> I think I'm approaching this problem from the wrong angle. Rather
> than play a sample through allegro's functions is there any way I
> can simply flex or relax the speakers a single time?
The SB does have a non-DMA mode where you can just write sample
values to the DAC whenever you feel like it, but I don't think
this will really do what you want (so what exactly do you want,
anyway? It would be useful if you could describe your goal in
a bit more detail :-) Modern soundcards are designed for playing
streams of sample data at a constant rate, and I think you will
have a lot of trouble coaxing them to emulate those old speaker
effects.
From what you said about playing a noise effect, why not just
generate a sample which contains this sound and then trigger it
at the appropriate times? If you want continual white noise, a
second or so of looping sample will do this very nicely.
If you want to generate a waveform on the fly, you can use the
Allegro audio streaming functions, as demonstrated in ex28.c.
Shawn Hargreaves.
- Raw text -