13 ALCint data[MAX_DATA];
14 ALCdevice *device = NULL;
15 ALCcontext *context = NULL;
20 device = alcOpenDevice(NULL);
23 printf("No default audio device available.\n");
26 context = alcCreateContext(device, NULL);
29 printf("Could not create a valid context.\n");
32 alcMakeContextCurrent(context);
34 s = alGetString(AL_VENDOR);
35 printf("AL_VENDOR = \"%s\"\n", s);
37 s = alGetString(AL_RENDERER);
38 printf("AL_RENDERER = \"%s\"\n", s);
40 s = alGetString(AL_VERSION);
41 printf("AL_VERSION = \"%s\"\n", s);
43 s = alGetString(AL_EXTENSIONS);
44 printf("AL_EXTENSIONS = \"%s\"\n", s);
49 if (alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT") == AL_TRUE)
51 s = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
52 printf("ALC_DEVICE_SPECIFIER = \"%s\"\n", s);
55 alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, data);
56 printf("ALC_MAJOR_VERSION = %i\n", *data);
57 alcGetIntegerv(device, ALC_MINOR_VERSION, 1, data);
58 printf("ALC_MINOR_VERSION = %i\n", *data);
60 s = alcGetString(device, ALC_EXTENSIONS);
61 printf("ALC_EXTENSIONS = \"%s\"\n", s);
63 if ((error = alcGetError(device)))
65 printf("Error #%i occured\n", error);
69 s = alcGetString(device, ALC_DEFAULT_DEVICE_SPECIFIER);
70 printf("ALC_DEFAULT_DEVICE_SPECIFIER = \"%s\"\n", s);
72 if ((error = alcGetError(device)))
74 printf("Error #%i occured\n", error);
79 alcGetIntegerv(device, ALC_ATTRIBUTES_SIZE, 1, &i);
80 printf("ALC attributes(%i): ", i);
82 alcGetIntegerv(device, ALC_ALL_ATTRIBUTES, i, data);
85 printf("%i ", data[j]);
89 if ((error = alcGetError(device)))
91 printf("Error #%i occured\n", error);
96 ret = alcCloseDevice(device);