minimodem-mirror/src/simpleaudio.h

59 lines
1.1 KiB
C
Raw Normal View History

2011-06-08 23:00:22 +02:00
/*
* simpleaudio.h
*
* Copyright (C) 2011 Kamal Mostafa <kamal@whence.com>
*
* NO LICENSE HAS BEEN SPECIFIED OR GRANTED FOR THIS WORK.
*
*/
#ifndef SIMPLEAUDIO_H
#define SIMPLEAUDIO_H
#include <sys/types.h>
struct simpleaudio;
typedef struct simpleaudio simpleaudio;
/*
* simpleaudio_open_source_XXXX() routines which return a (simpleaudio *)
* are provided by the separate backend modules.
*
*/
2011-06-17 23:21:31 +02:00
enum {
SA_STREAM_PLAYBACK,
SA_STREAM_RECORD,
};
simpleaudio *
2011-06-17 23:21:31 +02:00
simpleaudio_open_stream_pulseaudio(
// unsigned int rate, unsigned int channels,
2011-06-17 23:21:31 +02:00
int sa_stream_direction,
char *app_name, char *stream_name );
simpleaudio *
simpleaudio_open_source_sndfile(char *path);
/*
* common simpleaudio_ API routines available to any backend:
*/
unsigned int
simpleaudio_get_rate( simpleaudio *sa );
unsigned int
simpleaudio_get_channels( simpleaudio *sa );
ssize_t
simpleaudio_read( simpleaudio *sa, float *buf, size_t nframes );
2011-06-17 23:21:31 +02:00
ssize_t
simpleaudio_write( simpleaudio *sa, float *buf, size_t nframes );
void
simpleaudio_close( simpleaudio *sa );
#endif