42 string fullPath = Path.GetDirectoryName(
45 Environment.SetEnvironmentVariable(
"PATH", $
"{fullPath};{RunPath.GetEnvironmentPath()}", EnvironmentVariableTarget.Process);
52 Log.
Error(
"Could not create audio device");
73 AL.GetSourceProperty((uint)item.
m_source, GetSourceInteger.SourceState, out
int sourceState);
74 if (sourceState == (
int)SourceState.Stopped) {
89 AL.SetListenerProperty(ListenerFloat.Gain, volume);
103 AudioError error =
AL.GetError();
104 if (error != AudioError.NoError) {
105 Log.
Error($
"OPENAL ERROR: {error}");
117 AudioError error =
AL.GetError();
118 if (error != AudioError.NoError) {
119 Log.
Error($
"OPENAL ERROR: {error}");
125 catch (Exception e) {
126 Log.
Error($
"Unable to load OPENAL: {e}");
SharpDX.Direct3D11.Device Device
System.Environment Environment
static void InternalSetMasterVolume(float volume)
static HashSet< Sound > m_soundsToStopPoll
static bool m_isInitialized
static ALContext m_audioContext
static AudioError CheckALError()
static readonly List< Sound > m_soundsToStop
static bool CheckALErrorFull()
完整检查 OpenAL 是否可用和有无问题
static float MasterVolume
static float m_masterVolume
static void BeforeFrame()
static void Error(object message)
static float Saturate(float x)
static string GetEntryPath()
获取运行入口路径(用命令行或者其他程序调用时调用者目录)
static string GetExecutablePath()
获取 EXE 或 dll 所在路径(包含文件自身路径)