Exemple #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));
     }
 }
Exemple #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);
     }
 }
Exemple #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);
     }
 }
Exemple #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));
 }