<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
The OpenAL device list is a NULL-delimited list, terminated by a
double-NULL.&nbsp; This can be a pain to deal with, but it was necessary
because hardware vendors often like to put any kind of character in
their device names, including the useful delimiters like spaces, tabs,
commas, and semicolons.<br>
<br>
Try this code (stolen from an old Creative example):<br>
<br>
<tt><br>
char *deviceList;<br>
char *devices[12];<br>
int numDevices;<br>
<br>
deviceList = (char *)alcGetString(NULL, ALC_DEVICE_SPECIFIER);<br>
memset(devices, 0, sizeof(devices));<br>
for (numDevices = 0; numDevices &lt; 12; numDevices++) {<br>
&nbsp;&nbsp;&nbsp; devices[numDevices] = deviceList;<br>
&nbsp;&nbsp;&nbsp; deviceList += strlen(deviceList);<br>
&nbsp;&nbsp;&nbsp; if (deviceList[0] == 0) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (deviceList[1] == 0) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; deviceList += 1;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
}<br>
<br>
for (i = 0; i &lt; numDevices; i++)<br>
{<br>
&nbsp;&nbsp; printf("Device %d:&nbsp; %s\n", i, devices[i]);<br>
}<br>
</tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
<br>
<br>
<br>
Manolache Adrian wrote:
<blockquote cite="mid:141927.98648.qm@web56207.mail.re3.yahoo.com"
 type="cite">
  <table border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td
 style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;"
 valign="top">
        <div>After each compile i tried to run openal-info but twice i
received: <br>
"ALC error Invalid Context occured"<br>
&nbsp;<br>
I then ran my own program and tried to enumerate the devices like so:<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp; char *device = (char*)alcGetString(NULL,
ALC_DEFAULT_DEVICE_SPECIFIER);<br>
&nbsp;&nbsp;&nbsp; char *deviceS = (char*)alcGetString(NULL, ALC_DEVICE_SPECIFIER);<br>
&nbsp;&nbsp;&nbsp; printf("Device: %s\nDevice: %s", deviceS, device);<br>
&nbsp;&nbsp;&nbsp; int a = 0;<br>
&nbsp;&nbsp;&nbsp; while(1)<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (*(deviceS++));<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a++;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; deviceS++;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (a==2)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((*deviceS))<br>
printf("Device: %s\n", deviceS);<br>
&nbsp;&nbsp;&nbsp; }<br>
exit(0);<br>
        <br>
The output looked like this:<br>
Device: Wave File Writer</div>
        <div>&nbsp;</div>
        <div>I'm wondering what am i doing wrong, portaudio should have
been present in there, right?</div>
        <div>What am i missing?</div>
        <div>&nbsp;</div>
        </td>
      </tr>
    </tbody>
  </table>
  <br>
</blockquote>
<br>
</body>
</html>