| 1 |
/*************************************************************************/ |
| 2 |
/* */ |
| 3 |
/* Language Technologies Institute */ |
| 4 |
/* Carnegie Mellon University */ |
| 5 |
/* Copyright (c) 2001 */ |
| 6 |
/* All Rights Reserved. */ |
| 7 |
/* */ |
| 8 |
/* Permission is hereby granted, free of charge, to use and distribute */ |
| 9 |
/* this software and its documentation without restriction, including */ |
| 10 |
/* without limitation the rights to use, copy, modify, merge, publish, */ |
| 11 |
/* distribute, sublicense, and/or sell copies of this work, and to */ |
| 12 |
/* permit persons to whom this work is furnished to do so, subject to */ |
| 13 |
/* the following conditions: */ |
| 14 |
/* 1. The code must retain the above copyright notice, this list of */ |
| 15 |
/* conditions and the following disclaimer. */ |
| 16 |
/* 2. Any modifications must be clearly marked as such. */ |
| 17 |
/* 3. Original authors' names are not deleted. */ |
| 18 |
/* 4. The authors' names are not used to endorse or promote products */ |
| 19 |
/* derived from this software without specific prior written */ |
| 20 |
/* permission. */ |
| 21 |
/* */ |
| 22 |
/* CARNEGIE MELLON UNIVERSITY AND THE CONTRIBUTORS TO THIS WORK */ |
| 23 |
/* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */ |
| 24 |
/* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */ |
| 25 |
/* SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE */ |
| 26 |
/* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */ |
| 27 |
/* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */ |
| 28 |
/* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */ |
| 29 |
/* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */ |
| 30 |
/* THIS SOFTWARE. */ |
| 31 |
/* */ |
| 32 |
/*************************************************************************/ |
| 33 |
/* Author: Alan W Black ([email protected]) */ |
| 34 |
/* Date: January 2001 */ |
| 35 |
/*************************************************************************/ |
| 36 |
/* */ |
| 37 |
/* Selects between audio devices */ |
| 38 |
/* */ |
| 39 |
/*************************************************************************/ |
| 40 |
|
| 41 |
#ifndef _NATIVE_AUDIO_H__ |
| 42 |
#define _NATIVE_AUDIO_H__ |
| 43 |
|
| 44 |
#ifdef CST_AUDIO_COMMAND |
| 45 |
|
| 46 |
#define AUDIO_OPEN_NATIVE audio_open_command |
| 47 |
#define AUDIO_CLOSE_NATIVE audio_close_command |
| 48 |
#define AUDIO_SET_SAMPLE_RATE_NATIVE audio_set_sample_rate_command |
| 49 |
#define AUDIO_WRITE_NATIVE audio_write_command |
| 50 |
#define AUDIO_DRAIN_NATIVE audio_drain_command |
| 51 |
#define AUDIO_FLUSH_NATIVE audio_flush_command |
| 52 |
|
| 53 |
#endif |
| 54 |
|
| 55 |
#ifdef CST_AUDIO_SUNOS |
| 56 |
|
| 57 |
#define AUDIO_OPEN_NATIVE audio_open_sun |
| 58 |
#define AUDIO_CLOSE_NATIVE audio_close_sun |
| 59 |
#define AUDIO_SET_SAMPLE_RATE_NATIVE audio_set_sample_rate_sun |
| 60 |
#define AUDIO_WRITE_NATIVE audio_write_sun |
| 61 |
#define AUDIO_DRAIN_NATIVE audio_drain_sun |
| 62 |
#define AUDIO_FLUSH_NATIVE audio_flush_sun |
| 63 |
|
| 64 |
#endif |
| 65 |
|
| 66 |
#ifdef CST_AUDIO_LINUX |
| 67 |
|
| 68 |
#define AUDIO_OPEN_NATIVE audio_open_oss |
| 69 |
#define AUDIO_CLOSE_NATIVE audio_close_oss |
| 70 |
#define AUDIO_SET_SAMPLE_RATE_NATIVE audio_set_sample_rate_oss |
| 71 |
#define AUDIO_WRITE_NATIVE audio_write_oss |
| 72 |
#define AUDIO_DRAIN_NATIVE audio_drain_oss |
| 73 |
#define AUDIO_FLUSH_NATIVE audio_flush_oss |
| 74 |
|
| 75 |
#endif |
| 76 |
|
| 77 |
#ifdef CST_AUDIO_ALSA |
| 78 |
|
| 79 |
#define AUDIO_OPEN_NATIVE audio_open_alsa |
| 80 |
#define AUDIO_CLOSE_NATIVE audio_close_alsa |
| 81 |
#define AUDIO_SET_SAMPLE_RATE_NATIVE audio_set_sample_rate_alsa |
| 82 |
#define AUDIO_WRITE_NATIVE audio_write_alsa |
| 83 |
#define AUDIO_DRAIN_NATIVE audio_drain_alsa |
| 84 |
#define AUDIO_FLUSH_NATIVE audio_flush_alsa |
| 85 |
|
| 86 |
#endif |
| 87 |
|
| 88 |
#ifdef CST_AUDIO_PULSEAUDIO |
| 89 |
|
| 90 |
#define AUDIO_OPEN_NATIVE audio_open_pulseaudio |
| 91 |
#define AUDIO_CLOSE_NATIVE audio_close_pulseaudio |
| 92 |
#define AUDIO_SET_SAMPLE_RATE_NATIVE audio_set_sample_rate_pulseaudio |
| 93 |
#define AUDIO_WRITE_NATIVE audio_write_pulseaudio |
| 94 |
#define AUDIO_DRAIN_NATIVE audio_drain_pulseaudio |
| 95 |
#define AUDIO_FLUSH_NATIVE audio_flush_pulseaudio |
| 96 |
|
| 97 |
#endif |
| 98 |
|
| 99 |
#ifdef CST_AUDIO_FREEBSD |
| 100 |
|
| 101 |
#define AUDIO_OPEN_NATIVE audio_open_oss |
| 102 |
#define AUDIO_CLOSE_NATIVE audio_close_oss |
| 103 |
#define AUDIO_SET_SAMPLE_RATE_NATIVE audio_set_sample_rate_oss |
| 104 |
#define AUDIO_WRITE_NATIVE audio_write_oss |
| 105 |
#define AUDIO_DRAIN_NATIVE audio_drain_oss |
| 106 |
#define AUDIO_FLUSH_NATIVE audio_flush_oss |
| 107 |
|
| 108 |
#endif |
| 109 |
|
| 110 |
#ifdef CST_AUDIO_WINCE |
| 111 |
|
| 112 |
#define AUDIO_OPEN_NATIVE audio_open_wince |
| 113 |
#define AUDIO_CLOSE_NATIVE audio_close_wince |
| 114 |
#define AUDIO_SET_SAMPLE_RATE_NATIVE audio_set_sample_rate_wince |
| 115 |
#define AUDIO_WRITE_NATIVE audio_write_wince |
| 116 |
#define AUDIO_DRAIN_NATIVE audio_drain_wince |
| 117 |
#define AUDIO_FLUSH_NATIVE audio_flush_wince |
| 118 |
|
| 119 |
#endif |
| 120 |
|
| 121 |
#ifdef CST_AUDIO_WIN32 |
| 122 |
#define AUDIO_OPEN_NATIVE audio_open_win |
| 123 |
#define AUDIO_CLOSE_NATIVE audio_close_win |
| 124 |
#define AUDIO_SET_SAMPLE_RATE_NATIVE audio_set_sample_rate_win |
| 125 |
#define AUDIO_WRITE_NATIVE audio_write_win |
| 126 |
#define AUDIO_DRAIN_NATIVE audio_drain_win |
| 127 |
#define AUDIO_FLUSH_NATIVE audio_flush_win |
| 128 |
|
| 129 |
#endif |
| 130 |
|
| 131 |
#ifdef CST_AUDIO_PALMOS |
| 132 |
|
| 133 |
#define AUDIO_OPEN_NATIVE audio_open_palmos |
| 134 |
#define AUDIO_CLOSE_NATIVE audio_close_palmos |
| 135 |
#define AUDIO_SET_SAMPLE_RATE_NATIVE audio_set_sample_rate_palmos |
| 136 |
#define AUDIO_WRITE_NATIVE audio_write_palmos |
| 137 |
#define AUDIO_DRAIN_NATIVE audio_drain_palmos |
| 138 |
#define AUDIO_FLUSH_NATIVE audio_flush_palmos |
| 139 |
|
| 140 |
#endif |
| 141 |
|
| 142 |
#ifdef CST_AUDIO_NONE |
| 143 |
|
| 144 |
#define AUDIO_OPEN_NATIVE audio_open_none |
| 145 |
#define AUDIO_CLOSE_NATIVE audio_close_none |
| 146 |
#define AUDIO_SET_SAMPLE_RATE_NATIVE audio_set_sample_rate_none |
| 147 |
#define AUDIO_WRITE_NATIVE audio_write_none |
| 148 |
#define AUDIO_DRAIN_NATIVE audio_drain_none |
| 149 |
#define AUDIO_FLUSH_NATIVE audio_flush_none |
| 150 |
|
| 151 |
#endif |
| 152 |
|
| 153 |
#ifndef AUDIO_OPEN_NATIVE |
| 154 |
|
| 155 |
#define AUDIO_OPEN_NATIVE audio_open_none |
| 156 |
#define AUDIO_CLOSE_NATIVE audio_close_none |
| 157 |
#define AUDIO_SET_SAMPLE_RATE_NATIVE audio_set_sample_rate_none |
| 158 |
#define AUDIO_WRITE_NATIVE audio_write_none |
| 159 |
#define AUDIO_DRAIN_NATIVE audio_drain_none |
| 160 |
#define AUDIO_FLUSH_NATIVE audio_flush_none |
| 161 |
#define CST_AUDIO_NONE |
| 162 |
|
| 163 |
#endif |
| 164 |
|
| 165 |
cst_audiodev *AUDIO_OPEN_NATIVE(int sps, int channels, cst_audiofmt fmt); |
| 166 |
int AUDIO_CLOSE_NATIVE(cst_audiodev *ad); |
| 167 |
int AUDIO_WRITE_NATIVE(cst_audiodev *ad,void *buff,int num_bytes); |
| 168 |
int AUDIO_DRAIN_NATIVE(cst_audiodev *ad); |
| 169 |
int AUDIO_FLUSH_NATIVE(cst_audiodev *ad); |
| 170 |
|
| 171 |
#endif |