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

NAME

6       get_audio_stream_buffer - Tells you if you need to fill the audiostream
7       or not. Allegro game programming library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       void *get_audio_stream_buffer(AUDIOSTREAM *stream);
14

DESCRIPTION

16       You must call this function at regular intervals while an audio  stream
17       is  playing, to provide the next buffer of sample data (the smaller the
18       stream buffer size, the more often it must be  called).  This  function
19       should not be called from a timer handler. Example:
20
21          void *mem_chunk;
22          ...
23          while (TRUE) {
24             ...
25             mem_chunk = get_audio_stream_buffer(buffer);
26             if (mem_chunk != NULL) {
27                /* Refill the stream buffer. */
28             }
29          }
30

RETURN VALUE

32       If  it  returns  NULL,  the stream is still playing the previous lot of
33       data, so you don't need to do anything. If it returns a value, that  is
34       the  location  of the next buffer to be played, and you should load the
35       appropriate number of samples (however many you specified when creating
36       the  stream)  to that address, for example using an fread() from a disk
37       file.  After filling the buffer with data, call  free_audio_stream_buf‐
38       fer() to indicate that the new data is now valid.
39
40

SEE ALSO

42       play_audio_stream(3), free_audio_stream_buffer(3), exstream(3)
43
44
45
46Allegro                          version 4.4.3      get_audio_stream_buffer(3)
Impressum