[Openal] Detecting sound cards
Daniel PEACOCK
dpeacock at creativelabs.com
Wed Oct 11 16:13:33 PDT 2006
Hi Jeremy,
The Windows AL SDK (
http://developer.creative.com/articles/article.asp?cat=1&sbcat=31&top=38&aid=45
) includes sample code that shows how to use device enumeration (to
discover all the available AL devices on the system) and how to query the
capabilities of each device (e.g what extensions are supported, which
version of AL is supported, how many Sources can be generated, etc ... etc
...).
Some quick answers to your questions ....
The number of channels can be found by continuously generating one source
at a time until the alGenSources call sets an AL Error code. This will
tell you the number of 3D Mono channels that can be played back
simultaneously. If you need to play stereo buffers as well as 3D mono
buffers then you can tell OpenAL to reserve enough voices for X number of
Stereo Sources by using the Context Creation hint ALC_STEREO_SOURCES. In
this case the number of Sources that can be generated will be lowered so
that you are guaranteed to be able to play X Stereo Buffers and (Total Num
of Sources - X) Mono Buffers.
To get the list of available OpenAL devices you can use alcGetString(NULL,
ALC_DEVICE_SPECIFIER). This will return a NULL character separated list of
devices. To get the capabilities of a device you must open that device
first. So, once you have your list of devices, open each device in turn,
create a context, make it current, and then get the capabilities you want,
then destroy the context and the device, and move on to the next device in
the list.
Dan
Notice
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying or distribution of the message, or
any action taken by you in reliance on it, is prohibited and may be
unlawful. If you have received this message in error, please delete it
and contact the sender immediately. Thank you.
"Jeremy Henry"
<jeremy_h at hotmail
.com> To
Sent by: Openal at opensource.creative.com
openal-bounces at op cc
ensource.creative
.com Subject
[Openal] Detecting sound cards
10/11/2006 02:53
PM
I need to detect the attributes of the user's sound card or specifically
the
number of channels the sound card has. Right now I am using a hard coded
32
channel limit on sounds but we want to be able to detect the limit instead.
Is this supported? In the programmer's guide it looks like I am supposed
to
use alcGetString to get the device's name but I am not sure how to use it.
For the first parameter should I pass it an ALC device (or array of them) I
declare to access the parameters of each device? Can I pass
ALC_DEFAULT_DEVICE_SPECIFIER to get my default sound card to get that
information if this is the correct function?
Thanks,
Jeremy
_______________________________________________
Openal mailing list
Openal at opensource.creative.com
http://opensource.creative.com/mailman/listinfo/openal
ForwardSourceID:NT00037B06
More information about the Openal
mailing list