5 # include <OpenAL/al.h>
6 # include <OpenAL/alc.h>
11 # include <AL/alext.h>
15 #ifndef AL_VERSION_1_1
17 # include <OpenAL/altypes.h>
18 # include <OpenAL/alctypes.h>
20 # include <AL/altypes.h>
21 # include <AL/alctypes.h>
29 ALCint data[MAX_DATA];
30 ALCdevice *device = NULL;
31 ALCcontext *context = NULL;
35 device = alcOpenDevice(NULL);
38 printf("No default audio device available.\n");
41 context = alcCreateContext(device, NULL);
44 printf("Could not create a valid context.\n");
47 alcMakeContextCurrent(context);
49 s = alGetString(AL_VENDOR);
50 printf("AL_VENDOR = \"%s\"\n", s);
52 s = alGetString(AL_RENDERER);
53 printf("AL_RENDERER = \"%s\"\n", s);
55 s = alGetString(AL_VERSION);
56 printf("AL_VERSION = \"%s\"\n", s);
58 s = alGetString(AL_EXTENSIONS);
59 printf("AL_EXTENSIONS = \"%s\"\n", s);
64 if (alcIsExtensionPresent(NULL, (const ALchar *)"ALC_ENUMERATION_EXT") == AL_TRUE)
66 s = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
67 printf("ALC_DEVICE_SPECIFIER = \"%s\"\n", s);
70 alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, data);
71 printf("ALC_MAJOR_VERSION = %i\n", *data);
72 alcGetIntegerv(device, ALC_MINOR_VERSION, 1, data);
73 printf("ALC_MINOR_VERSION = %i\n", *data);
75 s = alcGetString(device, ALC_EXTENSIONS);
76 printf("ALC_EXTENSIONS = \"%s\"\n", s);
78 if ((error = alcGetError(device)))
80 printf("Error #%i occured\n", error);
84 s = alcGetString(device, ALC_DEFAULT_DEVICE_SPECIFIER);
85 printf("ALC_DEFAULT_DEVICE_SPECIFIER = \"%s\"\n", s);
87 if ((error = alcGetError(device)))
89 printf("Error #%i occured\n", error);
94 alcGetIntegerv(device, ALC_ATTRIBUTES_SIZE, 1, &i);
95 printf("ALC attributes(%i): ", i);
97 alcGetIntegerv(device, ALC_ALL_ATTRIBUTES, i, data);
100 printf("%i ", data[j]);
104 if ((error = alcGetError(device)))
106 printf("Error #%i occured\n", error);
111 alcCloseDevice(device);