5 # include <OpenAL/al.h>
6 # include <OpenAL/alc.h>
10 # include <AL/alext.h>
13 #ifndef AL_VERSION_1_1
15 # include <OpenAL/altypes.h>
16 # include <OpenAL/alctypes.h>
18 # include <AL/altypes.h>
19 # include <AL/alctypes.h>
28 ALCint data[MAX_DATA];
29 ALCdevice *device = NULL;
30 ALCcontext *context = NULL;
31 const unsigned char *s;
34 device = alcOpenDevice(NULL);
37 printf("No default audio device available.\n");
40 context = alcCreateContext(device, NULL);
43 printf("Could not create a valid context.\n");
46 alcMakeContextCurrent(context);
48 s = alGetString(AL_VENDOR);
49 printf("AL_VENDOR = \"%s\"\n", s);
51 s = alGetString(AL_RENDERER);
52 printf("AL_RENDERER = \"%s\"\n", s);
54 s = alGetString(AL_VERSION);
55 printf("AL_VERSION = \"%s\"\n", s);
57 s = alGetString(AL_EXTENSIONS);
58 printf("AL_EXTENSIONS = \"%s\"\n", s);
63 if (alcIsExtensionPresent(NULL, (unsigned char *)"ALC_ENUMERATION_EXT") == AL_TRUE)
65 s = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
66 printf("ALC_DEVICE_SPECIFIER = \"%s\"\n", s);
69 alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, data);
70 printf("ALC_MAJOR_VERSION = %i\n", *data);
71 alcGetIntegerv(device, ALC_MINOR_VERSION, 1, data);
72 printf("ALC_MINOR_VERSION = %i\n", *data);
74 s = alcGetString(device, ALC_EXTENSIONS);
75 printf("ALC_EXTENSIONS = \"%s\"\n", s);
77 if ((error = alcGetError(device)))
79 printf("Error #%i occured\n", error);
83 s = alcGetString(device, ALC_DEFAULT_DEVICE_SPECIFIER);
84 printf("ALC_DEFAULT_DEVICE_SPECIFIER = \"%s\"\n", s);
86 if ((error = alcGetError(device)))
88 printf("Error #%i occured\n", error);
93 alcGetIntegerv(device, ALC_ATTRIBUTES_SIZE, 1, &i);
94 printf("ALC attributes(%i): ", i);
96 alcGetIntegerv(device, ALC_ALL_ATTRIBUTES, i, data);
99 printf("%i ", data[j]);
103 if ((error = alcGetError(device)))
105 printf("Error #%i occured\n", error);
110 alcCloseDevice(device);