Skip to content

How to get list of available devices using Silk.NET.OpenAL? #573

Answered by Perksey
asheesh1996 asked this question in Q&A
Discussion options

You must be logged in to vote

Ah apologies, I had an answer written for this the day you opened this but apparently never hit send.

You'll have to use ALContext and its enumaration extensions (which are not guaranteed to be available as they are extensions!)

These are in the Silk.NET.OpenAL.Extensions.Enumeration package. Using this package, you can get a string list containing all available device specifiers. It'll look something like this:

using var alc = ALContext.GetApi();
string deviceSpecifier = "";
if (alc.IsExtensionPresent(null, "ALC_ENUMERATION_EXT"))
{
    using var enumeration = alc.GetExtension<Enumeration>();
    foreach (var device in enumeration.GetStringList(null, GetEnumerationContextStringList.Devic…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Perksey
Comment options

@LaXiS96
Comment options

@Perksey
Comment options

Answer selected by asheesh1996
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #572 on August 11, 2021 09:45.