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 */
60 //@IODOOM3: "typedef void" doesn't work on gcc.
61 //typedef void ALvoid;
64 /** OpenAL enumerations. */
68 #define AL_INVALID (-1)
80 * Indicate the type of AL_SOURCE.
81 * Sources can be spatialized
83 #define AL_SOURCE_TYPE 0x200
85 /** Indicate source has absolute coordinates. */
86 #define AL_SOURCE_ABSOLUTE 0x201
88 /** Indicate Source has listener relative coordinates. */
89 #define AL_SOURCE_RELATIVE 0x202
92 * Directional source, inner cone angle, in degrees.
96 #define AL_CONE_INNER_ANGLE 0x1001
99 * Directional source, outer cone angle, in degrees.
103 #define AL_CONE_OUTER_ANGLE 0x1002
106 * Specify the pitch to be applied, either at source,
107 * or on mixer results, at listener.
111 #define AL_PITCH 0x1003
114 * Specify the current location in three dimensional space.
115 * OpenAL, like OpenGL, uses a right handed coordinate system,
116 * where in a frontal default view X (thumb) points right,
117 * Y points up (index finger), and Z points towards the
118 * viewer/camera (middle finger).
119 * To switch from a left handed coordinate system, flip the
120 * sign on the Z coordinate.
121 * Listener position is always in the world coordinate system.
123 #define AL_POSITION 0x1004
125 /** Specify the current direction as forward vector. */
126 #define AL_DIRECTION 0x1005
128 /** Specify the current velocity in three dimensional space. */
129 #define AL_VELOCITY 0x1006
132 * Indicate whether source has to loop infinite.
134 * Range: [AL_TRUE, AL_FALSE]
137 #define AL_LOOPING 0x1007
140 * Indicate the buffer to provide sound samples.
142 * Range: any valid Buffer id.
144 #define AL_BUFFER 0x1009
147 * Indicate the gain (volume amplification) applied.
150 * A value of 1.0 means un-attenuated/unchanged.
151 * Each division by 2 equals an attenuation of -6dB.
152 * Each multiplicaton with 2 equals an amplification of +6dB.
153 * A value of 0.0 is meaningless with respect to a logarithmic
154 * scale; it is interpreted as zero volume - the channel
155 * is effectively disabled.
157 #define AL_GAIN 0x100A
160 * Indicate minimum source attenuation.
164 #define AL_MIN_GAIN 0x100D
167 * Indicate maximum source attenuation.
171 #define AL_MAX_GAIN 0x100E
174 * Specify the current orientation.
175 * Type: ALfv6 (at/up)
178 #define AL_ORIENTATION 0x100F
180 /* byte offset into source (in canon format). -1 if source
181 * is not playing. Don't set this, get this.
187 #define AL_REFERENCE_DISTANCE 0x1020
190 * Indicate the rolloff factor for the source.
195 #define AL_ROLLOFF_FACTOR 0x1021
198 * Indicate the gain (volume amplification) applied.
201 * A value of 1.0 means un-attenuated/unchanged.
202 * Each division by 2 equals an attenuation of -6dB.
203 * Each multiplicaton with 2 equals an amplification of +6dB.
204 * A value of 0.0 is meaningless with respect to a logarithmic
205 * scale; it is interpreted as zero volume - the channel
206 * is effectively disabled.
208 #define AL_CONE_OUTER_GAIN 0x1022
211 * Specify the maximum distance.
215 #define AL_MAX_DISTANCE 0x1023
218 * Specify the channel mask. (Creative)
222 #define AL_CHANNEL_MASK 0x3000
225 * Source state information
227 #define AL_SOURCE_STATE 0x1010
228 #define AL_INITIAL 0x1011
229 #define AL_PLAYING 0x1012
230 #define AL_PAUSED 0x1013
231 #define AL_STOPPED 0x1014
234 * Buffer Queue params
236 #define AL_BUFFERS_QUEUED 0x1015
237 #define AL_BUFFERS_PROCESSED 0x1016
239 /** Sound buffers: format specifier. */
240 #define AL_FORMAT_MONO8 0x1100
241 #define AL_FORMAT_MONO16 0x1101
242 #define AL_FORMAT_STEREO8 0x1102
243 #define AL_FORMAT_STEREO16 0x1103
246 * Sound buffers: frequency, in units of Hertz [Hz].
247 * This is the number of samples per second. Half of the
248 * sample frequency marks the maximum significant
249 * frequency component.
251 #define AL_FREQUENCY 0x2001
252 #define AL_BITS 0x2002
253 #define AL_CHANNELS 0x2003
254 #define AL_SIZE 0x2004
255 #define AL_DATA 0x2005
260 * Not supported for public use (yet).
262 #define AL_UNUSED 0x2010
263 #define AL_PENDING 0x2011
264 #define AL_PROCESSED 0x2012
266 /** Errors: No Error. */
267 #define AL_NO_ERROR AL_FALSE
270 * Illegal name passed as an argument to an AL call.
272 #define AL_INVALID_NAME 0xA001
275 * Illegal enum passed as an argument to an AL call.
277 #define AL_INVALID_ENUM 0xA002
279 * Illegal value passed as an argument to an AL call.
280 * Applies to parameter values, but not to enumerations.
282 #define AL_INVALID_VALUE 0xA003
285 * A function was called at inappropriate time,
286 * or in an inappropriate way, causing an illegal state.
287 * This can be an incompatible ALenum, object ID,
290 #define AL_INVALID_OPERATION 0xA004
293 * A function could not be completed,
294 * because there is not enough memory available.
296 #define AL_OUT_OF_MEMORY 0xA005
298 /** Context strings: Vendor Name. */
299 #define AL_VENDOR 0xB001
300 #define AL_VERSION 0xB002
301 #define AL_RENDERER 0xB003
302 #define AL_EXTENSIONS 0xB004
304 /** Global tweakage. */
307 * Doppler scale. Default 1.0
309 #define AL_DOPPLER_FACTOR 0xC000
312 * Doppler velocity. Default 1.0
314 #define AL_DOPPLER_VELOCITY 0xC001
317 * Distance model. Default AL_INVERSE_DISTANCE_CLAMPED
319 #define AL_DISTANCE_MODEL 0xD000
321 /** Distance models. */
323 #define AL_INVERSE_DISTANCE 0xD001
324 #define AL_INVERSE_DISTANCE_CLAMPED 0xD002