X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=libsamplerate%2Fexamples%2Faudio_out.h;fp=libsamplerate%2Fexamples%2Faudio_out.h;h=1bca1c063ee521b9fffa7eb7c230e6165ba4e87c;hb=8529da432e52c7903e8ef3488e60725a099e6e63;hp=0000000000000000000000000000000000000000;hpb=27013d8f68878b8ed2d3f747e26f562d08d7d678;p=audio-libsamplerate.git diff --git a/libsamplerate/examples/audio_out.h b/libsamplerate/examples/audio_out.h new file mode 100644 index 0000000..1bca1c0 --- /dev/null +++ b/libsamplerate/examples/audio_out.h @@ -0,0 +1,25 @@ +/* +** Copyright (c) 1999-2016, Erik de Castro Lopo +** All rights reserved. +** +** This code is released under 2-clause BSD license. Please see the +** file at : https://github.com/erikd/libsamplerate/blob/master/COPYING +*/ + +typedef struct AUDIO_OUT_s AUDIO_OUT ; + +typedef int (*get_audio_callback_t) (void *callback_data, float *samples, int frames) ; + +/* A general audio output function (Linux/ALSA, Linux/OSS, Win32, MacOSX, +** Solaris) which retrieves data using the callback function in the above +** struct. +** +** audio_open - opens the device and returns an anonymous pointer to its +** own private data. +*/ + +AUDIO_OUT *audio_open (int channels, int samplerate) ; + +void audio_play (get_audio_callback_t callback, AUDIO_OUT *audio_out, void *callback_data) ; + +void audio_close (AUDIO_OUT *audio_data) ;