1ALLEGRO_AUDIO_STREAM(3)                                ALLEGRO_AUDIO_STREAM(3)
2
3
4

NAME

6       ALLEGRO_AUDIO_STREAM - Allegro 5 API
7

SYNOPSIS

9              #include <allegro5/allegro_audio.h>
10
11              typedef struct ALLEGRO_AUDIO_STREAM ALLEGRO_AUDIO_STREAM;
12

DESCRIPTION

14       An ALLEGRO_AUDIO_STREAM object is used to stream generated audio to the
15       sound device, in real-time.  This is done by  reading  from  a  buffer,
16       which  is  split  into  a number of fragments.  Whenever a fragment has
17       finished playing, the user can refill it with new data.
18
19       As with ALLEGRO_SAMPLE_INSTANCE(3) objects, streams  store  information
20       necessary  for  playback,  so you may not play the same stream multiple
21       times simultaneously.  Streams also need to be  attached  to  an  ALLE‐
22       GRO_MIXER(3), which, eventually, reaches an ALLEGRO_VOICE(3) object.
23
24       While  playing,  you  must  periodically  fill fragments with new audio
25       data.  To know when a new fragment is  ready  to  be  filled,  you  can
26       either  directly check with al_get_available_audio_stream_fragments(3),
27       or listen to events from the stream.
28
29       You can register an audio stream event source to an  event  queue;  see
30       al_get_audio_stream_event_source(3).               An             ALLE‐
31       GRO_EVENT_AUDIO_STREAM_FRAGMENT event is generated whenever a new frag‐
32       ment     is    ready.     When    you    receive    an    event,    use
33       al_get_audio_stream_fragment(3) to obtain a pointer to the fragment  to
34       be filled.  The size and format are determined by the parameters passed
35       to al_create_audio_stream(3).
36
37       If you're late with supplying new data, the stream will be silent until
38       new  data  is  provided.   You  must call al_drain_audio_stream(3) when
39       you're finished with supplying data to the stream.
40
41       If the stream is created by al_load_audio_stream(3) then it  will  also
42       generate an ALLEGRO_EVENT_AUDIO_STREAM_FINISHED event if it reaches the
43       end of the file and is not set to loop.
44
45
46
47Allegro reference manual                               ALLEGRO_AUDIO_STREAM(3)
Impressum