//OpenAL private static void PrepareOpenAL() { alAudioDevice = ALC.OpenDevice(null); alAudioContext = ALC.CreateContext(alAudioDevice, null); if (!ALC.MakeContextCurrent(alAudioContext)) { throw new InvalidOperationException("Unable to make context current"); } Console.WriteLine("Created OpenAL context."); //Require float32 support. const string Float32Extension = "AL_EXT_float32"; if (!AL.IsExtensionPresent(Float32Extension)) { throw new Exception($"This program requires '{Float32Extension}' OpenAL extension to function."); } CheckALErrors(); Console.WriteLine("OpenAL is ready."); }
private static void UnloadOpenAL() { ALC.DestroyContext(alAudioContext); ALC.CloseDevice(alAudioDevice); }