|
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.
|
|
◆ 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
-
hWaveOut | A handle to the wave output device. |
lockObject | An object used for synchronization to prevent concurrent access to the wave output device. |
- Exceptions
-
Exception | Thrown 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.
◆ GetWaveOutVolume()
static float NAudio.Wave.WaveOutUtils.GetWaveOutVolume |
( |
IntPtr | hWaveOut, |
|
|
object | lockObject ) |
|
inlinestatic |
Gets the volume level of the specified wave output device.
- Parameters
-
hWaveOut | The handle to the wave output device. |
lockObject | An 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
-
MmException | Thrown when an error occurs while retrieving the volume level. |
◆ SetWaveOutVolume()
static void NAudio.Wave.WaveOutUtils.SetWaveOutVolume |
( |
float | value, |
|
|
IntPtr | hWaveOut, |
|
|
object | lockObject ) |
|
inlinestatic |
Sets the volume for the specified wave output device.
- Parameters
-
value | The volume level to be set, ranging from 0.0 to 1.0. |
hWaveOut | The handle to the wave output device. |
lockObject | An object used for synchronization. |
- Exceptions
-
ArgumentOutOfRangeException | Thrown 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.
The documentation for this class was generated from the following file:
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/Plugins/LiveMicrophone/lib/NAudio.WinMM/WaveOutUtils.cs