From f7a059d258198add50550f85231fb24f9de2ab45 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sun, 20 Jan 2008 21:00:59 +0000 Subject: [PATCH] Removed check for available_devices.Count > 0. Device enumeration is an extension, and may not always be available. --- Source/OpenTK/OpenAL/AudioContext.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/OpenTK/OpenAL/AudioContext.cs b/Source/OpenTK/OpenAL/AudioContext.cs index 10ad5856..e25efcf2 100644 --- a/Source/OpenTK/OpenAL/AudioContext.cs +++ b/Source/OpenTK/OpenAL/AudioContext.cs @@ -170,7 +170,6 @@ namespace OpenTK.Audio { if (Alc.IsExtensionPresent(IntPtr.Zero, "ALC_ENUMERATION_EXT")) { - available_devices = new List(); available_devices.AddRange(Alc.GetString(IntPtr.Zero, AlcGetStringList.AllDevicesSpecifier)); } } @@ -207,7 +206,8 @@ namespace OpenTK.Audio if (freq < 0) throw new ArgumentOutOfRangeException("freq", freq, "Should be greater than zero."); if (refresh < 0) throw new ArgumentOutOfRangeException("refresh", refresh, "Should be greater than zero."); if (maxEfxSends < 0) throw new ArgumentOutOfRangeException("maxEfxSends", maxEfxSends, "Should be greater than zero."); - if (available_devices.Count == 0) throw new NotSupportedException("No audio hardware is available."); + //if (available_devices.Count == 0) throw new NotSupportedException("No audio hardware is available."); + if (available_contexts.Count == 0) Debug.Print("Failed to enumerate devices."); device_handle = Alc.OpenDevice(device); if (device_handle == IntPtr.Zero) @@ -215,7 +215,7 @@ namespace OpenTK.Audio device_name = device; - // Build the attribute liist + // Build the attribute list List attributes = new List(); if (freq != 0)