Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

get_audio_stream_buffer(3alleg4) [centos man page]

get_audio_stream_buffer(3alleg4)				  Allegro manual				  get_audio_stream_buffer(3alleg4)

get_audio_stream_buffer - Tells you if you need to fill the audiostream or not. Allegro game programming library. SYNOPSIS
#include <allegro.h> void *get_audio_stream_buffer(AUDIOSTREAM *stream); DESCRIPTION
You must call this function at regular intervals while an audio stream is playing, to provide the next buffer of sample data (the smaller the stream buffer size, the more often it must be called). This function should not be called from a timer handler. Example: void *mem_chunk; ... while (TRUE) { ... mem_chunk = get_audio_stream_buffer(buffer); if (mem_chunk != NULL) { /* Refill the stream buffer. */ } } RETURN VALUE
If it returns NULL, the stream is still playing the previous lot of data, so you don't need to do anything. If it returns a value, that is the location of the next buffer to be played, and you should load the appropriate number of samples (however many you specified when creat- ing the stream) to that address, for example using an fread() from a disk file. After filling the buffer with data, call free_audio_stream_buffer() to indicate that the new data is now valid. SEE ALSO
play_audio_stream(3alleg4), free_audio_stream_buffer(3alleg4), exstream(3alleg4) Allegro version 4.4.2 get_audio_stream_buffer(3alleg4)

Check Out this Related Man Page

exstream(3alleg4)						  Allegro manual						 exstream(3alleg4)

exstream - Playing audio streams. Allegro game programming library. SYNOPSIS
#include <allegro.h> Example exstream DESCRIPTION
This program shows how to use the audio stream functions to transfer large blocks of sample data to the sound card. In this case, the sam- ple data is generated during runtime, and the resulting sound reminds of a car engine when you are accelerating. SEE ALSO
AUDIOSTREAM(3alleg4), END_OF_MAIN(3alleg4), SCREEN_H(3alleg4), SCREEN_W(3alleg4), allegro_error(3alleg4), allegro_init(3alleg4), alle- gro_message(3alleg4), clear_to_color(3alleg4), desktop_palette(3alleg4), font(3alleg4), free_audio_stream_buffer(3alleg4), get_audio_stream_buffer(3alleg4), install_keyboard(3alleg4), install_sound(3alleg4), install_timer(3alleg4), keypressed(3alleg4), makecol(3alleg4), play_audio_stream(3alleg4), readkey(3alleg4), screen(3alleg4), set_gfx_mode(3alleg4), set_palette(3alleg4), stop_audio_stream(3alleg4), textprintf_centre_ex(3alleg4), voice_start(3alleg4), voice_stop(3alleg4) Allegro version 4.4.2 exstream(3alleg4)
Man Page

Featured Tech Videos