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>
30 ALCint data
[MAX_DATA
];
31 ALCdevice
*device
= NULL
;
32 ALCcontext
*context
= NULL
;
33 const unsigned char *s
;
36 device
= alcOpenDevice(NULL
);
39 printf("No default audio device available.\n");
42 context
= alcCreateContext(device
, NULL
);
45 printf("Could not create a valid context.\n");
48 alcMakeContextCurrent(context
);
50 s
= alGetString(AL_VENDOR
);
51 printf("AL_VENDOR = \"%s\"\n", s
);
53 s
= alGetString(AL_RENDERER
);
54 printf("AL_RENDERER = \"%s\"\n", s
);
56 s
= alGetString(AL_VERSION
);
57 printf("AL_VERSION = \"%s\"\n", s
);
59 s
= alGetString(AL_EXTENSIONS
);
60 printf("AL_EXTENSIONS = \"%s\"\n", s
);
65 if (alcIsExtensionPresent(NULL
, (unsigned char *)"ALC_ENUMERATION_EXT") == AL_TRUE
)
67 s
= alcGetString(NULL
, ALC_DEVICE_SPECIFIER
);
68 printf("ALC_DEVICE_SPECIFIER = \"%s\"\n", s
);
71 alcGetIntegerv(device
, ALC_MAJOR_VERSION
, 1, data
);
72 printf("ALC_MAJOR_VERSION = %i\n", *data
);
73 alcGetIntegerv(device
, ALC_MINOR_VERSION
, 1, data
);
74 printf("ALC_MINOR_VERSION = %i\n", *data
);
76 s
= alcGetString(device
, ALC_EXTENSIONS
);
77 printf("ALC_EXTENSIONS = \"%s\"\n", s
);
79 if ((error
= alcGetError(device
)))
81 printf("Error #%i occured\n", error
);
85 s
= alcGetString(device
, ALC_DEFAULT_DEVICE_SPECIFIER
);
86 printf("ALC_DEFAULT_DEVICE_SPECIFIER = \"%s\"\n", s
);
88 if ((error
= alcGetError(device
)))
90 printf("Error #%i occured\n", error
);
95 alcGetIntegerv(device
, ALC_ATTRIBUTES_SIZE
, 1, &i
);
96 printf("ALC attributes(%i): ", i
);
98 alcGetIntegerv(device
, ALC_ALL_ATTRIBUTES
, i
, data
);
101 printf("%i ", data
[j
]);
105 if ((error
= alcGetError(device
)))
107 printf("Error #%i occured\n", error
);
112 alcCloseDevice(device
);