<div dir="ltr">Thanks for that!<div><br></div><div>I'm mainly just interested in diagnosing people's audio problems, not munging up my app or anything dodgy like that. For example, I'm not yet even sure whether *my* app is using openal-soft or not on my new ubuntu setup, since openal 'just works'.</div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 19, 2014 at 10:32 AM, Chris Robinson <span dir="ltr"><<a href="mailto:chris.kcat@gmail.com" target="_blank">chris.kcat@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 06/15/2014 08:44 PM, Mark Sibly wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Another quicky: How can I tell whether the system openal is in fact<br>
openal-soft? And if so, which version?<br>
</blockquote>
<br></div>
Generally speaking, you should check for the capabilities that you actually want (extensions, function behaviors, etc), rather than the specific implementation/version. It's entirely possible for another implementation to come around, now or in the future, that does everything you need, and there's no real reason to restrict it. Of course, having a default version (which you built/tested with, and ship with) is entirely reasonable.<br>

<br>
But if you really want to check, the AL_VERSION string will tell you. For OpenAL Soft, it's in the format:<br>
<br>
<core_major>.<core_minor> ALSOFT <lib_major>.<lib_minor>[.<lib_<u></u>rev>]<br>
<br>
So to parse that using sscanf, you can do:<br>
<br>
int alsoftver[2];<br>
const ALchar *verstring = alGetString(AL_VERSION);<br>
int ret = sscanf(verstring, "%*d.%*d ALSOFT %d.%d", &alsoftver[0],<br>
                 &alsoftver[1]);<br>
if(ret == 2)<br>
    printf("Detected OpenAL Soft, library version %d.%d",<br>
            alsoftver[0], alsoftver[1]);<br>
<br>
The lib may have a third version point, but not all versions report it. If you want it, you could do:<br>
<br>
int alsoftver[3];<br>
const ALchar *verstring = alGetString(AL_VERSION);<br>
int ret = sscanf(verstring, "%*d.%*d ALSOFT %d.%d.%d", &alsoftver[0],<br>
                 &alsoftver[1], &alsoftver[2]);<br>
if(ret >= 2)<br>
{<br>
    if(ret == 2)<br>
        alsoftver[2] = 0;<br>
    printf("Detected OpenAL Soft, library version %d.%d.%d",<br>
            alsoftver[0], alsoftver[1], alsoftver[2]);<br>
}<br>
<br>
<br>
Note that you can only safely call alGetString after a context has been made current, and it applies only to the device that context belongs to.<div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
openal mailing list<br>
<a href="mailto:openal@openal.org" target="_blank">openal@openal.org</a><br>
<a href="http://openal.org/mailman/listinfo/openal" target="_blank">http://openal.org/mailman/<u></u>listinfo/openal</a><br>
</div></div></blockquote></div><br></div>