/// <summary> /// Checks to see that the ALC_ENUMERATION_EXT extension is present. This will always be available in 1.1 devices or later. /// </summary> /// <param name="device">The device to check the extension is present for.</param> /// <returns>If the ALC_ENUMERATION_EXT extension was present.</returns> public static bool IsEnumerationExtensionPresent(ALCaptureDevice device) => IsExtensionPresent(device, "ALC_ENUMERATION_EXT");
// ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *buffer ); /// <summary>This function returns integers related to the context.</summary> /// <param name="device">A pointer to the device to be queried.</param> /// <param name="param">An attribute to be retrieved: ALC_MAJOR_VERSION, ALC_MINOR_VERSION, ALC_ATTRIBUTES_SIZE, ALC_ALL_ATTRIBUTES.</param> /// <param name="size">The size of the destination buffer provided, in number of integers.</param> /// <param name="data">A pointer to the buffer to be returned.</param> [DllImport(Lib, EntryPoint = "alcGetIntegerv", ExactSpelling = true, CallingConvention = AlcCallingConv, CharSet = CharSet.Ansi)] public static extern void GetInteger(ALCaptureDevice device, AlcGetInteger param, int size, out int data);
// ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *buffer ); /// <summary> /// Gets the current number of available capture samples. /// </summary> /// <param name="device">The device.</param> /// <returns>The number of capture samples available.</returns> public static int GetAvailableSamples(ALCaptureDevice device) { GetInteger(device, AlcGetInteger.CaptureSamples, 1, out int result); return(result); }
// ALC_API void ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples ); /// <summary>This function completes a capture operation, and does not block.</summary> /// <typeparam name="T">The buffer datatype.</typeparam> /// <param name="device">A pointer to a capture device.</param> /// <param name="buffer">A reference to a buffer, which must be large enough to accommodate the number of samples.</param> /// <param name="samples">The number of samples to be retrieved.</param> public static unsafe void CaptureSamples <T>(ALCaptureDevice device, ref T buffer, int samples) where T : unmanaged { fixed(T *ptr = &buffer) CaptureSamples(device, ptr, samples); }
/// <summary>This function completes a capture operation, and does not block.</summary> /// <typeparam name="T">The buffer datatype.</typeparam> /// <param name="device">A pointer to a capture device.</param> /// <param name="buffer">A buffer, which must be large enough to accommodate the number of samples.</param> /// <param name="samples">The number of samples to be retrieved.</param> public static void CaptureSamples <T>(ALCaptureDevice device, T[] buffer, int samples) where T : unmanaged => CaptureSamples(device, ref buffer[0], samples);
// ALC_API void ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples ); /// <summary>This function completes a capture operation, and does not block.</summary> /// <param name="device">A pointer to a capture device.</param> /// <param name="buffer">A pointer to a buffer, which must be large enough to accommodate the number of samples.</param> /// <param name="samples">The number of samples to be retrieved.</param> [DllImport(Lib, EntryPoint = "alcCaptureSamples", ExactSpelling = true, CallingConvention = AlcCallingConv)] public static extern void CaptureSamples(ALCaptureDevice device, ref short buffer, int samples);
// ALC_API void ALC_APIENTRY alcCaptureStart( ALCdevice *device ); /// <summary>This function stops a capture operation.</summary> /// <param name="device">A pointer to a capture device.</param> [DllImport(Lib, EntryPoint = "alcCaptureStop", ExactSpelling = true, CallingConvention = AlcCallingConv)] public static extern void CaptureStop([In] ALCaptureDevice device);
// ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize ); /// <summary>This function closes the specified capture device.</summary> /// <param name="device">A pointer to a capture device.</param> /// <returns>Returns True if the close operation was successful, False on failure.</returns> [DllImport(Lib, EntryPoint = "alcCaptureCloseDevice", ExactSpelling = true, CallingConvention = AlcCallingConv)] public static extern bool CaptureCloseDevice([In] ALCaptureDevice device);
/// <summary> /// Checks to see that the ALC_EXT_CAPTURE extension is present. This will always be available in 1.1 devices or later. /// </summary> /// <param name="device">The device to check the extension is present for.</param> /// <returns>If the ALC_EXT_CAPTURE extension was present.</returns> public static bool IsCaptureExtensionPresent(ALCaptureDevice device) => IsExtensionPresent(device, "ALC_EXT_CAPTURE");
// ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname ); /// <summary>This function queries if a specified context extension is available.</summary> /// <param name="device">A pointer to the device to be queried for an extension.</param> /// <param name="extname">A null-terminated string describing the extension.</param> /// <returns>Returns True if the extension is available, False if the extension is not available.</returns> [DllImport(Lib, EntryPoint = "alcIsExtensionPresent", ExactSpelling = true, CallingConvention = AlcCallingConv, CharSet = CharSet.Ansi)] public static extern bool IsExtensionPresent([In] ALCaptureDevice device, [In] string extname);