Add audio support for Mac (via OpenAL soft)

This commit is contained in:
Wojtek Figat
2022-01-05 11:09:36 +01:00
parent 7471a819e1
commit dd569b9f1e
3 changed files with 47 additions and 6 deletions

View File

@@ -54,8 +54,8 @@ public class Audio : EngineModule
options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS5", "Engine", "Audio"));
options.CompileEnv.PreprocessorDefinitions.Add("AUDIO_API_PS5");
break;
case TargetPlatform.Mac:
useNone = true; // TODO: Audio support on Mac
case TargetPlatform.Mac:
useOpenAL = true;
break;
default: throw new InvalidPlatformException(options.Platform.Target);
}
@@ -85,6 +85,12 @@ public class Audio : EngineModule
options.OutputFiles.Add(Path.Combine(depsRoot, "libopenal.a"));
options.Libraries.Add("OpenSLES");
break;
case TargetPlatform.Mac:
options.OutputFiles.Add(Path.Combine(depsRoot, "libopenal.a"));
options.Libraries.Add("CoreAudio.framework");
options.Libraries.Add("AudioUnit.framework");
options.Libraries.Add("AudioToolbox.framework");
break;
default: throw new InvalidPlatformException(options.Platform.Target);
}
}