Exemplo n.º 1
0
 /// <summary>
 /// Create the default backend for the current operating system
 /// </summary>
 /// <param name="options">the settings for this audio engine</param>
 /// <returns></returns>
 public static AudioEngine CreateDefault(AudioEngineOptions options)
 {
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
     {
         return(CreateXAudio(options));
     }
     else
     {
         return(CreateOpenAL(options));
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a new <see cref="AudioEngine"/> using XAudio 2.
 /// </summary>
 /// <param name="options">the settings for this audio engine</param>
 /// <returns>A new <see cref="AudioEngine"/> using the XAudio 2 API.</returns>
 public static AudioEngine CreateXAudio(AudioEngineOptions options)
 {
     try
     {
         return(new XA2.XA2Engine(options));
     }
     catch
     {
         return(null);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a new <see cref="AudioEngine"/> using OpenAL.
 /// </summary>
 /// <param name="options">the settings for this audio engine</param>
 /// <returns>A new <see cref="AudioEngine"/> using the openal API. If not possible returns null</returns>
 public static AudioEngine CreateOpenAL(AudioEngineOptions options)
 {
     try
     {
         return(new AL.ALEngine(options));
     }
     catch (TypeInitializationException)
     {
         return(null);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a new <see cref="AudioEngine"/> using XAudio 2.
 /// </summary>
 /// <param name="options">the settings for this audio engine</param>
 /// <returns>A new <see cref="AudioEngine"/> using the XAudio 2 API.</returns>
 public static AudioEngine CreateXAudio(AudioEngineOptions options)
 {
     return(new XA2.XA2Engine(options));
 }