docs: update in readme
[transsip.git] / src / alsa.h
blob1fbfd4dbf5d7d5204fdaf825c11003d01d196ed3
1 /*
2 * transsip - the telephony toolkit
3 * By Daniel Borkmann <daniel@transsip.org>
4 * Copyright 2011, 2012 Daniel Borkmann <dborkma@tik.ee.ethz.ch>,
5 * Swiss federal institute of technology (ETH Zurich)
6 * Subject to the GPL, version 2.
7 */
9 #ifndef ALSA_H
10 #define ALSA_H
12 #include <sys/poll.h>
14 struct alsa_dev;
16 extern struct alsa_dev *alsa_open(char *devname, unsigned int rate,
17 int channels, int period);
18 extern void alsa_close(struct alsa_dev *dev);
19 extern ssize_t alsa_read(struct alsa_dev *dev, short *pcm, size_t len);
20 extern ssize_t alsa_write(struct alsa_dev *dev, const short *pcm, size_t len);
21 extern int alsa_cap_ready(struct alsa_dev *dev, struct pollfd *pfds,
22 unsigned int nfds);
23 extern int alsa_play_ready(struct alsa_dev *dev, struct pollfd *pfds,
24 unsigned int nfds);
25 extern void alsa_start(struct alsa_dev *dev);
26 extern void alsa_stop(struct alsa_dev *dev);
27 extern unsigned int alsa_nfds(struct alsa_dev *dev);
28 extern void alsa_getfds(struct alsa_dev *dev, struct pollfd *pfds,
29 unsigned int nfds);
31 #endif /* ALSA_H */