Recognizes if input is ogg or not.
[xiph/unicode.git] / speex / speexclient / alsa_device.h
bloba5b3787a65cd60f32a1c28393562f5127bbb5208
1 /*
2 Copyright (C) 2004-2006 Jean-Marc Valin
3 Copyright (C) 2006 Commonwealth Scientific and Industrial Research
4 Organisation (CSIRO) Australia
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are
8 met:
10 1. Redistributions of source code must retain the above copyright notice,
11 this list of conditions and the following disclaimer.
13 2. Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in the
15 documentation and/or other materials provided with the distribution.
17 3. The name of the author may not be used to endorse or promote products
18 derived from this software without specific prior written permission.
20 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
24 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
34 #ifndef ALSA_DEVICE_H
35 #define ALSA_DEVICE_H
37 #include <sys/poll.h>
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
43 struct AlsaDevice_;
45 typedef struct AlsaDevice_ AlsaDevice;
47 AlsaDevice *alsa_device_open(char *device_name, unsigned int rate, int channels, int period);
49 void alsa_device_close(AlsaDevice *dev);
51 int alsa_device_read(AlsaDevice *dev, short *pcm, int len);
53 int alsa_device_write(AlsaDevice *dev, const short *pcm, int len);
55 int alsa_device_capture_ready(AlsaDevice *dev, struct pollfd *pfds, unsigned int nfds);
57 int alsa_device_playback_ready(AlsaDevice *dev, struct pollfd *pfds, unsigned int nfds);
59 void alsa_device_start(AlsaDevice *dev);
61 int alsa_device_nfds(AlsaDevice *dev);
63 void alsa_device_getfds(AlsaDevice *dev, struct pollfd *pfds, unsigned int nfds);
65 #ifdef __cplusplus
67 #endif
69 #endif