Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new <see cref="AudioCapture"/> using MediaFoundation.
 /// </summary>
 /// <param name="options">the settings for this audio capture device</param>
 /// <returns>A new <see cref="AudioCapture"/> using the MediaFoundation API. If not possible returns null</returns>
 public static AudioCapture CreateMediaFoundation(AudioCaptureOptions options)
 {
     try
     {
         return(new MF.MFCapture(options));
     }
     catch (TypeInitializationException)
     {
         return(null);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Create the default backend for the current operating system
 /// </summary>
 /// <param name="options">the settings for this audio capture device</param>
 /// <returns></returns>
 public static AudioCapture CreateDefault(AudioCaptureOptions options)
 {
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
     {
         return(CreateMediaFoundation(options)); //TODO
     }
     else
     {
         return(CreateOpenAL(options));
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a new <see cref="AudioCapture"/> using OpenAL.
 /// </summary>
 /// <param name="options">the settings for this audio capture device</param>
 /// <returns>A new <see cref="AudioCapture"/> using the OpenAL API. If not possible returns null</returns>
 public static AudioCapture CreateOpenAL(AudioCaptureOptions options)
 {
     try
     {
         return(new AL.ALCapture(options));
     }
     catch (TypeInitializationException)
     {
         return(null);
     }
 }