Xeno-rat
Loading...
Searching...
No Matches
NAudio.Wave.WaveInterop Class Reference

MME Wave function interop. More...

Collaboration diagram for NAudio.Wave.WaveInterop:

Public Types

enum  WaveInOutOpenFlags {
  CallbackNull = 0 , CallbackFunction = 0x30000 , CallbackEvent = 0x50000 , CallbackWindow = 0x10000 ,
  CallbackThread = 0x20000
}
 
enum  WaveMessage {
  WaveInOpen = 0x3BE , WaveInClose = 0x3BF , WaveInData = 0x3C0 , WaveOutClose = 0x3BC ,
  WaveOutDone = 0x3BD , WaveOutOpen = 0x3BB
}
 

Public Member Functions

delegate void WaveCallback (IntPtr hWaveOut, WaveMessage message, IntPtr dwInstance, WaveHeader wavhdr, IntPtr dwReserved)
 
static Int32 mmioStringToFOURCC ([MarshalAs(UnmanagedType.LPStr)] String s, int flags)
 Converts a string to a FOURCC value.
 
static Int32 waveOutGetNumDevs ()
 Retrieves the number of waveform-audio output devices present in the system.
 
static MmResult waveOutPrepareHeader (IntPtr hWaveOut, WaveHeader lpWaveOutHdr, int uSize)
 Prepares the header for playback on a waveform-audio output device.
 
static MmResult waveOutUnprepareHeader (IntPtr hWaveOut, WaveHeader lpWaveOutHdr, int uSize)
 Notifies the audio device driver that it can return a buffer to the application.
 
static MmResult waveOutWrite (IntPtr hWaveOut, WaveHeader lpWaveOutHdr, int uSize)
 Sends a data block to the specified waveform-audio output device.
 
static MmResult waveOutOpen (out IntPtr hWaveOut, IntPtr uDeviceID, WaveFormat lpFormat, WaveCallback dwCallback, IntPtr dwInstance, WaveInOutOpenFlags dwFlags)
 Opens a waveform output device for playback.
 
static MmResult waveOutOpenWindow (out IntPtr hWaveOut, IntPtr uDeviceID, WaveFormat lpFormat, IntPtr callbackWindowHandle, IntPtr dwInstance, WaveInOutOpenFlags dwFlags)
 Opens a waveform-audio output device for playback.
 
static MmResult waveOutReset (IntPtr hWaveOut)
 Resets the specified waveform-audio output device.
 
static MmResult waveOutClose (IntPtr hWaveOut)
 Closes the specified waveform output device.
 
static MmResult waveOutPause (IntPtr hWaveOut)
 Pauses playback on the specified waveform-audio output device.
 
static MmResult waveOutRestart (IntPtr hWaveOut)
 Restarts playback on the specified waveform-audio output device.
 
static MmResult waveOutGetPosition (IntPtr hWaveOut, ref MmTime mmTime, int uSize)
 Retrieves the current playback position of the specified waveform output device.
 
static MmResult waveOutSetVolume (IntPtr hWaveOut, int dwVolume)
 Sets the volume level of the specified waveform-audio output device.
 
static MmResult waveOutGetVolume (IntPtr hWaveOut, out int dwVolume)
 Retrieves the current volume level of the specified waveform-audio output device.
 
static MmResult waveOutGetDevCaps (IntPtr deviceID, out WaveOutCapabilities waveOutCaps, int waveOutCapsSize)
 Retrieves the capabilities of a specified waveform-audio output device.
 
static Int32 waveInGetNumDevs ()
 Retrieves the number of waveform-audio input devices present in the system.
 
static MmResult waveInGetDevCaps (IntPtr deviceID, out WaveInCapabilities waveInCaps, int waveInCapsSize)
 Retrieves the capabilities of a specified input device.
 
static MmResult waveInAddBuffer (IntPtr hWaveIn, WaveHeader pwh, int cbwh)
 Adds a buffer to the specified waveform-audio input device.
 
static MmResult waveInClose (IntPtr hWaveIn)
 Closes the specified waveform-audio input device.
 
static MmResult waveInOpen (out IntPtr hWaveIn, IntPtr uDeviceID, WaveFormat lpFormat, WaveCallback dwCallback, IntPtr dwInstance, WaveInOutOpenFlags dwFlags)
 Opens a waveform input device for recording.
 
static MmResult waveInOpenWindow (out IntPtr hWaveIn, IntPtr uDeviceID, WaveFormat lpFormat, IntPtr callbackWindowHandle, IntPtr dwInstance, WaveInOutOpenFlags dwFlags)
 Opens a waveform-audio input device for recording.
 
static MmResult waveInPrepareHeader (IntPtr hWaveIn, WaveHeader lpWaveInHdr, int uSize)
 Prepares the specified waveform-audio input device for input.
 
static MmResult waveInUnprepareHeader (IntPtr hWaveIn, WaveHeader lpWaveInHdr, int uSize)
 Unprepares the header for wave input.
 
static MmResult waveInReset (IntPtr hWaveIn)
 Resets the specified waveform-audio input device.
 
static MmResult waveInStart (IntPtr hWaveIn)
 Starts input on the specified waveform-audio input device.
 
static MmResult waveInStop (IntPtr hWaveIn)
 Stops audio input on the specified waveform-audio input device.
 
static MmResult waveInGetPosition (IntPtr hWaveIn, out MmTime mmTime, int uSize)
 Retrieves the current position in the audio stream being played or recorded.
 

Detailed Description

MME Wave function interop.

Member Enumeration Documentation

◆ WaveInOutOpenFlags

Enumerator
CallbackNull 

CALLBACK_NULL No callback.

CallbackFunction 

CALLBACK_FUNCTION dwCallback is a FARPROC.

CallbackEvent 

CALLBACK_EVENT dwCallback is an EVENT handle.

CallbackWindow 

CALLBACK_WINDOW dwCallback is a HWND.

CallbackThread 

CALLBACK_THREAD callback is a thread ID.

◆ WaveMessage

Enumerator
WaveInOpen 

WIM_OPEN.

WaveInClose 

WIM_CLOSE.

WaveInData 

WIM_DATA.

WaveOutClose 

WOM_CLOSE.

WaveOutDone 

WOM_DONE.

WaveOutOpen 

WOM_OPEN.

Member Function Documentation

◆ mmioStringToFOURCC()

static Int32 NAudio.Wave.WaveInterop.mmioStringToFOURCC ( [MarshalAs(UnmanagedType.LPStr)] String s,
int flags )

Converts a string to a FOURCC value.

Parameters
sThe string to be converted to a FOURCC value.
flagsAdditional flags for the conversion.
Returns
The FOURCC value corresponding to the input string.

This method converts the input string s to a FOURCC value using the specified flags. The FOURCC (Four Character Code) is a sequence of four bytes used to uniquely identify data formats. The conversion is performed using the winmm.dll library function mmioStringToFOURCC.

◆ WaveCallback()

delegate void NAudio.Wave.WaveInterop.WaveCallback ( IntPtr hWaveOut,
WaveMessage message,
IntPtr dwInstance,
WaveHeader wavhdr,
IntPtr dwReserved )

◆ waveInAddBuffer()

static MmResult NAudio.Wave.WaveInterop.waveInAddBuffer ( IntPtr hWaveIn,
WaveHeader pwh,
int cbwh )

Adds a buffer to the specified waveform-audio input device.

Parameters
hWaveInHandle to the waveform-audio input device.
pwhPointer to a WaveHeader structure that identifies the buffer.
cbwhSize, in bytes, of the WaveHeader structure.
Exceptions
MmExceptionThrown when an error occurs while adding the buffer to the waveform-audio input device.
Here is the caller graph for this function:

◆ waveInClose()

static MmResult NAudio.Wave.WaveInterop.waveInClose ( IntPtr hWaveIn)

Closes the specified waveform-audio input device.

Parameters
hWaveInHandle to the waveform-audio input device. This handle is returned by the waveInOpen function.
Returns
Returns MMSYSERR_NOERROR if successful or an error otherwise.
Here is the caller graph for this function:

◆ waveInGetDevCaps()

static MmResult NAudio.Wave.WaveInterop.waveInGetDevCaps ( IntPtr deviceID,
out WaveInCapabilities waveInCaps,
int waveInCapsSize )

Retrieves the capabilities of a specified input device.

Parameters
deviceIDThe identifier of the input device.
waveInCapsWhen this method returns, contains the capabilities of the input device.
waveInCapsSizeThe size, in bytes, of the waveInCaps structure.
Returns
An MmResult value indicating the success or failure of the operation.
Here is the caller graph for this function:

◆ waveInGetNumDevs()

static Int32 NAudio.Wave.WaveInterop.waveInGetNumDevs ( )

Retrieves the number of waveform-audio input devices present in the system.

Returns
The number of waveform-audio input devices present in the system.

◆ waveInGetPosition()

static MmResult NAudio.Wave.WaveInterop.waveInGetPosition ( IntPtr hWaveIn,
out MmTime mmTime,
int uSize )

Retrieves the current position in the audio stream being played or recorded.

Parameters
hWaveInHandle to the input device.
mmTimeA reference to a MmTime structure that receives the current position.
uSizeThe size, in bytes, of the mmTime structure.
Returns
An MmResult value indicating the success or failure of the operation.
Here is the caller graph for this function:

◆ waveInOpen()

static MmResult NAudio.Wave.WaveInterop.waveInOpen ( out IntPtr hWaveIn,
IntPtr uDeviceID,
WaveFormat lpFormat,
WaveCallback dwCallback,
IntPtr dwInstance,
WaveInOutOpenFlags dwFlags )

Opens a waveform input device for recording.

Parameters
hWaveInThe handle of the opened waveform input device.
uDeviceIDThe device identifier of the waveform-audio input device to open.
lpFormatAn instance of the WaveFormat class that specifies the format of the waveform-audio data to be recorded.
dwCallbackThe address of a fixed callback function, an event handle, a handle to a window, or the identifier of a thread to be called during waveform-audio recording to process messages related to the progress of recording.
dwInstanceUser-instance data passed to the callback mechanism.
dwFlagsFlags for opening the waveform-audio input device.
Returns
The result of the operation as an MmResult value.

◆ waveInOpenWindow()

static MmResult NAudio.Wave.WaveInterop.waveInOpenWindow ( out IntPtr hWaveIn,
IntPtr uDeviceID,
WaveFormat lpFormat,
IntPtr callbackWindowHandle,
IntPtr dwInstance,
WaveInOutOpenFlags dwFlags )

Opens a waveform-audio input device for recording.

Parameters
hWaveInThe handle of the opened waveform-audio input device.
uDeviceIDThe identifier of the waveform-audio input device to open.
lpFormatA pointer to a WaveFormat structure that identifies the desired format for recording waveform-audio data.
callbackWindowHandleA handle to the window that will receive callback information when waveform-audio data is recorded.
dwInstanceUser-instance data passed to the callback function.
dwFlagsFlags for opening the waveform-audio input device.
Returns
An MmResult value indicating the success or failure of the operation.
Here is the caller graph for this function:

◆ waveInPrepareHeader()

static MmResult NAudio.Wave.WaveInterop.waveInPrepareHeader ( IntPtr hWaveIn,
WaveHeader lpWaveInHdr,
int uSize )

Prepares the specified waveform-audio input device for input.

Parameters
hWaveInHandle to the waveform-audio input device.
lpWaveInHdrPointer to a WaveHeader structure that identifies the waveform-audio data block to be prepared.
uSizeSize, in bytes, of the WaveHeader structure.
Returns
An MmResult value that indicates the result of the operation.
Here is the caller graph for this function:

◆ waveInReset()

static MmResult NAudio.Wave.WaveInterop.waveInReset ( IntPtr hWaveIn)

Resets the specified waveform-audio input device.

Parameters
hWaveInHandle to the waveform-audio input device.
Returns
An MmResult value that specifies the result of the operation.
Here is the caller graph for this function:

◆ waveInStart()

static MmResult NAudio.Wave.WaveInterop.waveInStart ( IntPtr hWaveIn)

Starts input on the specified waveform-audio input device.

Parameters
hWaveInHandle to the waveform-audio input device.
Returns
Returns MMSYSERR_NOERROR if successful, otherwise an error code.
Here is the caller graph for this function:

◆ waveInStop()

static MmResult NAudio.Wave.WaveInterop.waveInStop ( IntPtr hWaveIn)

Stops audio input on the specified waveform-audio input device.

Parameters
hWaveInHandle to the waveform-audio input device.
Returns
Returns an MmResult value indicating the result of the operation.
Here is the caller graph for this function:

◆ waveInUnprepareHeader()

static MmResult NAudio.Wave.WaveInterop.waveInUnprepareHeader ( IntPtr hWaveIn,
WaveHeader lpWaveInHdr,
int uSize )

Unprepares the header for wave input.

Parameters
hWaveInHandle to the waveform-audio input device.
lpWaveInHdrPointer to a WaveHeader structure that identifies the header to be unprepared.
uSizeSize, in bytes, of the WaveHeader structure.
Returns
Returns MmResult indicating the result of the operation.

This method unprepares the header for wave input on the specified waveform-audio input device.

Here is the caller graph for this function:

◆ waveOutClose()

static MmResult NAudio.Wave.WaveInterop.waveOutClose ( IntPtr hWaveOut)

Closes the specified waveform output device.

Parameters
hWaveOutHandle to the waveform-audio output device. This parameter can also be a device identifier.
Returns
An MmResult value indicating the result of the operation.
Here is the caller graph for this function:

◆ waveOutGetDevCaps()

static MmResult NAudio.Wave.WaveInterop.waveOutGetDevCaps ( IntPtr deviceID,
out WaveOutCapabilities waveOutCaps,
int waveOutCapsSize )

Retrieves the capabilities of a specified waveform-audio output device.

Parameters
deviceIDThe identifier of the waveform-audio output device.
waveOutCapsAn output parameter that receives the capabilities of the specified waveform-audio output device.
waveOutCapsSizeThe size, in bytes, of the waveOutCaps parameter.
Returns
An MmResult value indicating the success or failure of the function call.
Here is the caller graph for this function:

◆ waveOutGetNumDevs()

static Int32 NAudio.Wave.WaveInterop.waveOutGetNumDevs ( )

Retrieves the number of waveform-audio output devices present in the system.

Returns
The number of waveform-audio output devices present in the system.

◆ waveOutGetPosition()

static MmResult NAudio.Wave.WaveInterop.waveOutGetPosition ( IntPtr hWaveOut,
ref MmTime mmTime,
int uSize )

Retrieves the current playback position of the specified waveform output device.

Parameters
hWaveOutHandle to the waveform output device.
mmTimeReference to an MmTime structure that receives the current playback position.
uSizeSize of the MmTime structure.
Returns
Returns an MmResult value indicating the success or failure of the operation.

This method retrieves the current playback position of the specified waveform output device and stores it in the provided MmTime structure. The MmTime structure contains timing information for various multimedia devices.

Here is the caller graph for this function:

◆ waveOutGetVolume()

static MmResult NAudio.Wave.WaveInterop.waveOutGetVolume ( IntPtr hWaveOut,
out int dwVolume )

Retrieves the current volume level of the specified waveform-audio output device.

Parameters
hWaveOutHandle to the waveform-audio output device.
dwVolumeReceives the current volume setting of the audio device. The low-order word contains the left-channel volume setting, and the high-order word contains the right-channel setting.
Returns
An MmResult value indicating the success or failure of the function call.
Here is the caller graph for this function:

◆ waveOutOpen()

static MmResult NAudio.Wave.WaveInterop.waveOutOpen ( out IntPtr hWaveOut,
IntPtr uDeviceID,
WaveFormat lpFormat,
WaveCallback dwCallback,
IntPtr dwInstance,
WaveInOutOpenFlags dwFlags )

Opens a waveform output device for playback.

Parameters
hWaveOutThe handle to the opened waveform output device.
uDeviceIDThe device identifier of the waveform-audio output device. It can be a device identifier or a handle of a MIDI output device.
lpFormatA pointer to a WaveFormat structure that identifies the format for waveform-audio data.
dwCallbackThe address of a callback function or a handle to an event that is called when playback has finished.
dwInstanceUser-instance data passed to the callback function or event handler.
dwFlagsFlags for opening the waveform-audio output device.
Returns
Returns an MmResult value indicating the result of the operation.

◆ waveOutOpenWindow()

static MmResult NAudio.Wave.WaveInterop.waveOutOpenWindow ( out IntPtr hWaveOut,
IntPtr uDeviceID,
WaveFormat lpFormat,
IntPtr callbackWindowHandle,
IntPtr dwInstance,
WaveInOutOpenFlags dwFlags )

Opens a waveform-audio output device for playback.

Parameters
hWaveOutThe address of a handle to be used to identify the opened waveform-audio output device.
uDeviceIDThe device identifier of the waveform-audio output device to open.
lpFormatA pointer to a WaveFormat structure that identifies the format of the waveform-audio data to be sent to the output device.
callbackWindowHandleA handle to a window that will receive callback information from the waveform-audio output device.
dwInstanceUser-instance data passed to the callback function.
dwFlagsFlags for opening the waveform-audio output device.
Returns
An MmResult value that specifies the result of the operation.
Here is the caller graph for this function:

◆ waveOutPause()

static MmResult NAudio.Wave.WaveInterop.waveOutPause ( IntPtr hWaveOut)

Pauses playback on the specified waveform-audio output device.

Parameters
hWaveOutHandle to the waveform-audio output device.
Returns
An MmResult value indicating the success or failure of the operation.

This method pauses playback on the specified waveform-audio output device identified by the handle hWaveOut . If successful, the method returns MmResult.NoError; otherwise, it returns an error code indicating the cause of failure.

Here is the caller graph for this function:

◆ waveOutPrepareHeader()

static MmResult NAudio.Wave.WaveInterop.waveOutPrepareHeader ( IntPtr hWaveOut,
WaveHeader lpWaveOutHdr,
int uSize )

Prepares the header for playback on a waveform-audio output device.

Parameters
hWaveOutHandle to the waveform-audio output device.
lpWaveOutHdrPointer to a WaveHeader structure that identifies the header to be prepared.
uSizeSize, in bytes, of the WaveHeader structure.
Returns
Returns an MmResult value representing the result of the operation.

This method prepares the specified header for playback on the specified waveform-audio output device. The header must be prepared with this method before it is used in playback operations.

Here is the caller graph for this function:

◆ waveOutReset()

static MmResult NAudio.Wave.WaveInterop.waveOutReset ( IntPtr hWaveOut)

Resets the specified waveform-audio output device.

Parameters
hWaveOutHandle to the waveform-audio output device.
Returns
An MmResult value that represents the result of the operation.
Here is the caller graph for this function:

◆ waveOutRestart()

static MmResult NAudio.Wave.WaveInterop.waveOutRestart ( IntPtr hWaveOut)

Restarts playback on the specified waveform-audio output device.

Parameters
hWaveOutHandle to the waveform-audio output device.
Returns
An MmResult value representing the success or failure of the operation.

This method restarts playback on the specified waveform-audio output device that was previously paused or stopped.

Here is the caller graph for this function:

◆ waveOutSetVolume()

static MmResult NAudio.Wave.WaveInterop.waveOutSetVolume ( IntPtr hWaveOut,
int dwVolume )

Sets the volume level of the specified waveform-audio output device.

Parameters
hWaveOutHandle to the waveform-audio output device.
dwVolumeNew volume setting for the audio device. The low-order word contains the left-channel volume setting, and the high-order word contains the right-channel setting.
Returns
Returns MMSYSERR_NOERROR if successful, otherwise an error code.
Here is the caller graph for this function:

◆ waveOutUnprepareHeader()

static MmResult NAudio.Wave.WaveInterop.waveOutUnprepareHeader ( IntPtr hWaveOut,
WaveHeader lpWaveOutHdr,
int uSize )

Notifies the audio device driver that it can return a buffer to the application.

Parameters
hWaveOutHandle to the audio output device.
lpWaveOutHdrPointer to a WaveHeader structure that identifies the buffer to be returned.
uSizeSize, in bytes, of the WaveHeader structure.
Returns
Returns MmResult indicating success or failure.
Here is the caller graph for this function:

◆ waveOutWrite()

static MmResult NAudio.Wave.WaveInterop.waveOutWrite ( IntPtr hWaveOut,
WaveHeader lpWaveOutHdr,
int uSize )

Sends a data block to the specified waveform-audio output device.

Parameters
hWaveOutHandle to the waveform-audio output device.
lpWaveOutHdrPointer to a WaveHeader structure that identifies the data block to be sent.
uSizeSize, in bytes, of the WaveHeader structure.
Returns
Returns MMSYSERR_NOERROR if successful or an error otherwise.
Here is the caller graph for this function:

The documentation for this class was generated from the following file: