5 * OpenAL cross platform audio library
6 * Copyright (C) 1999-2000 by authors.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
21 * Or go to http://www.gnu.org/copyleft/lgpl.html
29 /** OpenAL boolean type. */
30 typedef char ALboolean;
32 /** OpenAL 8bit signed byte. */
35 /** OpenAL 8bit unsigned byte. */
36 typedef unsigned char ALubyte;
38 /** OpenAL 16bit signed short integer type. */
39 typedef short ALshort;
41 /** OpenAL 16bit unsigned short integer type. */
42 typedef unsigned short ALushort;
44 /** OpenAL 32bit unsigned integer type. */
45 typedef unsigned ALuint;
47 /** OpenAL 32bit signed integer type. */
50 /** OpenAL 32bit floating point type. */
51 typedef float ALfloat;
53 /** OpenAL 64bit double point type. */
54 typedef double ALdouble;
56 /** OpenAL 32bit type. */
57 typedef unsigned int ALsizei;
59 /** OpenAL void type */
62 /** OpenAL enumerations. */
66 #define AL_INVALID (-1)
78 * Indicate the type of AL_SOURCE.
79 * Sources can be spatialized
81 #define AL_SOURCE_TYPE 0x200
83 /** Indicate source has absolute coordinates. */
84 #define AL_SOURCE_ABSOLUTE 0x201
86 /** Indicate Source has listener relative coordinates. */
87 #define AL_SOURCE_RELATIVE 0x202
90 * Directional source, inner cone angle, in degrees.
94 #define AL_CONE_INNER_ANGLE 0x1001
97 * Directional source, outer cone angle, in degrees.
101 #define AL_CONE_OUTER_ANGLE 0x1002
104 * Specify the pitch to be applied, either at source,
105 * or on mixer results, at listener.
109 #define AL_PITCH 0x1003
112 * Specify the current location in three dimensional space.
113 * OpenAL, like OpenGL, uses a right handed coordinate system,
114 * where in a frontal default view X (thumb) points right,
115 * Y points up (index finger), and Z points towards the
116 * viewer/camera (middle finger).
117 * To switch from a left handed coordinate system, flip the
118 * sign on the Z coordinate.
119 * Listener position is always in the world coordinate system.
121 #define AL_POSITION 0x1004
123 /** Specify the current direction as forward vector. */
124 #define AL_DIRECTION 0x1005
126 /** Specify the current velocity in three dimensional space. */
127 #define AL_VELOCITY 0x1006
130 * Indicate whether source has to loop infinite.
132 * Range: [AL_TRUE, AL_FALSE]
135 #define AL_LOOPING 0x1007
138 * Indicate the buffer to provide sound samples.
140 * Range: any valid Buffer id.
142 #define AL_BUFFER 0x1009
145 * Indicate the gain (volume amplification) applied.
148 * A value of 1.0 means un-attenuated/unchanged.
149 * Each division by 2 equals an attenuation of -6dB.
150 * Each multiplicaton with 2 equals an amplification of +6dB.
151 * A value of 0.0 is meaningless with respect to a logarithmic
152 * scale; it is interpreted as zero volume - the channel
153 * is effectively disabled.
155 #define AL_GAIN 0x100A
158 * Indicate minimum source attenuation.
162 #define AL_MIN_GAIN 0x100D
165 * Indicate maximum source attenuation.
169 #define AL_MAX_GAIN 0x100E
172 * Specify the current orientation.
173 * Type: ALfv6 (at/up)
176 #define AL_ORIENTATION 0x100F
178 /* byte offset into source (in canon format). -1 if source
179 * is not playing. Don't set this, get this.
185 #define AL_REFERENCE_DISTANCE 0x1020
188 * Indicate the rolloff factor for the source.
193 #define AL_ROLLOFF_FACTOR 0x1021
196 * Indicate the gain (volume amplification) applied.
199 * A value of 1.0 means un-attenuated/unchanged.
200 * Each division by 2 equals an attenuation of -6dB.
201 * Each multiplicaton with 2 equals an amplification of +6dB.
202 * A value of 0.0 is meaningless with respect to a logarithmic
203 * scale; it is interpreted as zero volume - the channel
204 * is effectively disabled.
206 #define AL_CONE_OUTER_GAIN 0x1022
209 * Specify the maximum distance.
213 #define AL_MAX_DISTANCE 0x1023
216 * Specify the channel mask. (Creative)
220 #define AL_CHANNEL_MASK 0x3000
223 * Source state information
225 #define AL_SOURCE_STATE 0x1010
226 #define AL_INITIAL 0x1011
227 #define AL_PLAYING 0x1012
228 #define AL_PAUSED 0x1013
229 #define AL_STOPPED 0x1014
232 * Buffer Queue params
234 #define AL_BUFFERS_QUEUED 0x1015
235 #define AL_BUFFERS_PROCESSED 0x1016
237 /** Sound buffers: format specifier. */
238 #define AL_FORMAT_MONO8 0x1100
239 #define AL_FORMAT_MONO16 0x1101
240 #define AL_FORMAT_STEREO8 0x1102
241 #define AL_FORMAT_STEREO16 0x1103
244 * Sound buffers: frequency, in units of Hertz [Hz].
245 * This is the number of samples per second. Half of the
246 * sample frequency marks the maximum significant
247 * frequency component.
249 #define AL_FREQUENCY 0x2001
250 #define AL_BITS 0x2002
251 #define AL_CHANNELS 0x2003
252 #define AL_SIZE 0x2004
253 #define AL_DATA 0x2005
258 * Not supported for public use (yet).
260 #define AL_UNUSED 0x2010
261 #define AL_PENDING 0x2011
262 #define AL_PROCESSED 0x2012
264 /** Errors: No Error. */
265 #define AL_NO_ERROR AL_FALSE
268 * Illegal name passed as an argument to an AL call.
270 #define AL_INVALID_NAME 0xA001
273 * Illegal enum passed as an argument to an AL call.
275 #define AL_INVALID_ENUM 0xA002
277 * Illegal value passed as an argument to an AL call.
278 * Applies to parameter values, but not to enumerations.
280 #define AL_INVALID_VALUE 0xA003
283 * A function was called at inappropriate time,
284 * or in an inappropriate way, causing an illegal state.
285 * This can be an incompatible ALenum, object ID,
288 #define AL_INVALID_OPERATION 0xA004
291 * A function could not be completed,
292 * because there is not enough memory available.
294 #define AL_OUT_OF_MEMORY 0xA005
296 /** Context strings: Vendor Name. */
297 #define AL_VENDOR 0xB001
298 #define AL_VERSION 0xB002
299 #define AL_RENDERER 0xB003
300 #define AL_EXTENSIONS 0xB004
302 /** Global tweakage. */
305 * Doppler scale. Default 1.0
307 #define AL_DOPPLER_FACTOR 0xC000
310 * Doppler velocity. Default 1.0
312 #define AL_DOPPLER_VELOCITY 0xC001
315 * Distance model. Default AL_INVERSE_DISTANCE_CLAMPED
317 #define AL_DISTANCE_MODEL 0xD000
319 /** Distance models. */
321 #define AL_INVERSE_DISTANCE 0xD001
322 #define AL_INVERSE_DISTANCE_CLAMPED 0xD002