Added header comment
[transsip.git] / src / alsa.h
blobc8da0ca7a6319c5d62695bd9e44c719eac302378
1 /*
2 * transsip - the telephony network
3 * By Daniel Borkmann <daniel@transsip.org>
4 * Copyright 2011 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 <stdlib.h>
13 #include <sys/poll.h>
14 #include <alsa/asoundlib.h>
16 struct alsa_dev;
18 extern struct alsa_dev *alsa_open(char *devname, unsigned int rate,
19 int channels, int period);
20 extern void alsa_close(struct alsa_dev *dev);
21 extern ssize_t alsa_read(struct alsa_dev *dev, short *pcm, size_t len);
22 extern ssize_t alsa_write(struct alsa_dev *dev, const short *pcm, size_t len);
23 extern int alsa_cap_ready(struct alsa_dev *dev, struct pollfd *pfds,
24 unsigned int nfds);
25 extern int alsa_play_ready(struct alsa_dev *dev, struct pollfd *pfds,
26 unsigned int nfds);
27 extern void alsa_start(struct alsa_dev *dev);
28 extern unsigned int alsa_nfds(struct alsa_dev *dev);
29 extern void alsa_getfds(struct alsa_dev *dev, struct pollfd *pfds,
30 unsigned int nfds);
32 #endif /* ALSA_H */