Mail Archives: djgpp/1999/08/11/08:13:45
Sahab Yazdani writes:
> - Search for SoundBlaster Properties (ie IRQ, DMA, DMA16, BASE IO)
> - Init using previous information (makes some variables containing
> writeports and stuff like that
> - Install a Handler (i'm really not sure what this is for but every
> sample I looked at had it so far it only contains code that acknowledges
> the writes (or something to this level))
> - Initialize a buffer of 2048 bytes in size (this is the mixing block)
> - Start the DAC (turn on Speaker, make sure SB knows some infomration
> about the buffer)
> - Open a RAW file and dumb 2048 bytes of information into the buffer
> - DeInit (Stop DAC, free buffer, uninstall handler)
You need to fill your sample data buffer _before_ you tell the soundcard
to start playing it, because the DMA goes on in the background. Also you
will need a time delay before you stop the DAC, to give the sound a
chance to play (although 2k is very short, so you won't hear much more
than a quick pop). And make sure that your sample buffer is valid for
a DMA input: it needs to be located in conventional memory, and not
crossing a 64k page boundary (see the Allegro dma.c source for one way
of allocating such a block).
Shawn Hargreaves.
- Raw text -