Xeno-rat
Loading...
Searching...
No Matches
NAudio.Wave.WaveOutUtils Class Reference
Collaboration diagram for NAudio.Wave.WaveOutUtils:

Static Public Member Functions

static float GetWaveOutVolume (IntPtr hWaveOut, object lockObject)
 Gets the volume level of the specified wave output device.
 
static void SetWaveOutVolume (float value, IntPtr hWaveOut, object lockObject)
 Sets the volume for the specified wave output device.
 
static long GetPositionBytes (IntPtr hWaveOut, object lockObject)
 Retrieves the current playback position in bytes from the specified wave output device.
 

Member Function Documentation

◆ GetPositionBytes()

static long NAudio.Wave.WaveOutUtils.GetPositionBytes ( IntPtr hWaveOut,
object lockObject )
inlinestatic

Retrieves the current playback position in bytes from the specified wave output device.

Parameters
hWaveOutA handle to the wave output device.
lockObjectAn object used for synchronization to prevent concurrent access to the wave output device.
Exceptions
ExceptionThrown when the wave output device fails to retrieve the position in bytes.
Returns
The current playback position in bytes.

This method retrieves the current playback position in bytes from the specified wave output device. It uses the MmTime structure to request the position in bytes and then checks if the retrieved type matches the requested type. If the retrieved type does not match, an exception is thrown with details about the mismatch.

Here is the call graph for this function:

◆ GetWaveOutVolume()

static float NAudio.Wave.WaveOutUtils.GetWaveOutVolume ( IntPtr hWaveOut,
object lockObject )
inlinestatic

Gets the volume level of the specified wave output device.

Parameters
hWaveOutThe handle to the wave output device.
lockObjectAn object used for synchronization.
Returns
The volume level of the wave output device as a floating-point number between 0.0 and 1.0.
Exceptions
MmExceptionThrown when an error occurs while retrieving the volume level.
Here is the call graph for this function:

◆ SetWaveOutVolume()

static void NAudio.Wave.WaveOutUtils.SetWaveOutVolume ( float value,
IntPtr hWaveOut,
object lockObject )
inlinestatic

Sets the volume for the specified wave output device.

Parameters
valueThe volume level to be set, ranging from 0.0 to 1.0.
hWaveOutThe handle to the wave output device.
lockObjectAn object used for synchronization.
Exceptions
ArgumentOutOfRangeExceptionThrown when the value is not within the range of 0.0 to 1.0.

This method sets the volume level for the specified wave output device using the hWaveOut handle. The volume level is determined by the value parameter, which should be within the range of 0.0 to 1.0. The method calculates the left and right channel volumes based on the provided value and then sets the stereo volume using the WaveInterop.waveOutSetVolume method. The operation is synchronized using the lockObject for thread safety.

Here is the call graph for this function:

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