delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/11/29/14:20:51

Message-ID: <F77915E7F086D31197F4009027CC81C90DC493@probe-2.as-london.acclaim.com>
From: Shawn Hargreaves <SHargreaves AT acclaimstudios DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: Allegro Digital Audio
Date: Mon, 29 Nov 1999 18:18:28 -0000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Reply-To: djgpp AT delorie DOT com

night.walker writes:
> 1. If i can use the DIGI_AUTODETECT parameter to install_sound()
>    why i need a configuration file?

Because the autodetection might not correctly pick up on all your
hardware, or you might want to change what it detects to use 
something else instead. And even if you don't need to do that on
your machine, someone else might need it if they want to run your
program on a computer with different sound hardware.

So when you use DIGI_AUTODETECT, Allegro looks for settings in the
config file, and then if it can't find a config file, it goes off
and tries to guess the actual hardware instead. If the guessing
works, you are in luck, or otherwise you can set up a config file
(either with a text editor or using the setup program).

> 2. How can I know the actual sfx or gfx mode that my program is using?
>    ie: there is something like gfx_capabilities (sfx_capabilities)?

Look at digi_driver->id to find the ID code of the driver, and
digi_driver->name and digi_driver->desc to find text information
about it. See allegro.h for the details, or any of the sound test
programs that print this information.

> 3. if i don't know the frequency i am using, how can i load samples
>    in the right way? Allegro will automatically convert 16 to 8 bit
>    freq once i have launched install_sound()?

Allegro will play any format of sample on any output device, so you
don't need to worry about that.

> 4. Which difference is between "sample" and "voice"?

A sample is a recording of a particular sound, which is held in memory.
A voice is an output channel which is used to play that sample. The
number of available voices depends on what sound config options you set,
but will always be a power of two somewhere between 1 and 64. Of these
voices, you could use each of them to play different samples, or you
could use them all to play many copies of the same sample at different
pitches, or you could keep changing them around to play one sample at
one moment, and a different sample the next. But at any given moment,
you can't be playing more different sounds than you have voices 
available.

Think of the voices as being like a number of people in a room, and the
samples as being the words which these people can say. It is up to you
to tell each person what words you want them to say, in order to
arrange whatever final combination of sounds you want to hear.

> 5. How can my program know when a sample has finished playing?

Call voice_get_position(), or voice_check(). You need to be using the
voice family of functions for this, rather than the simpler but less
flexible play_sample() routine.


	Shawn Hargreaves.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019