1play_sample(3)                  Allegro manual                  play_sample(3)
2
3
4

NAME

6       play_sample - Plays a sample. Allegro game programming library.
7

SYNOPSIS

9       #include <allegro.h>
10
11
12       int  play_sample(const  SAMPLE  *spl,  int  vol, int pan, int freq, int
13       loop);
14

DESCRIPTION

16       Triggers a sample at the specified volume, pan position, and frequency.
17       The  parameters  `vol'  and  `pan'  range  from  0  (min/left)  to  255
18       (max/right).  Frequency is relative rather than absolute:  1000  repreā€
19       sents  the  frequency  that  the  sample was recorded at, 2000 is twice
20       this, etc. If `loop' is not zero, the sample will repeat until you call
21       stop_sample(),  and  can  be manipulated while it is playing by calling
22       adjust_sample(). Example:
23
24          /* Scream from the left speaker, twice the freq. */
25          int sound = play_sample(scream, 255, 0, 2000, 0);
26

RETURN VALUE

28       Returns the voice number that was allocated for the sample or  negative
29       if no voices were available.
30
31

SEE ALSO

33       install_sound(3),   load_sample(3),  adjust_sample(3),  stop_sample(3),
34       exsample(3), exsprite(3)
35
36
37
38Allegro                          version 4.4.2                  play_sample(3)
Impressum