A buffer of Wave samples for streaming to a Wave Output device.
More...
|
| WaveOutBuffer (IntPtr hWaveOut, Int32 bufferSize, IWaveProvider bufferFillStream, object waveOutLock) |
| creates a new wavebuffer
|
|
void | Dispose () |
| Disposes of the managed and unmanaged resources used by the WaveOut device.
|
|
bool | OnDone () |
| Reads data from the wave stream, writes it to the output, and returns a boolean value indicating whether the operation is successful.
|
|
|
void | Dispose (bool disposing) |
| Releases resources held by this WaveBuffer.
|
|
|
bool | InQueue [get] |
| Whether the header's in queue flag is set.
|
|
int | BufferSize [get] |
| The buffer size in bytes.
|
|
A buffer of Wave samples for streaming to a Wave Output device.
◆ WaveOutBuffer()
NAudio.Wave.WaveOutBuffer.WaveOutBuffer |
( |
IntPtr | hWaveOut, |
|
|
Int32 | bufferSize, |
|
|
IWaveProvider | bufferFillStream, |
|
|
object | waveOutLock ) |
|
inline |
creates a new wavebuffer
- Parameters
-
hWaveOut | WaveOut device to write to |
bufferSize | Buffer size in bytes |
bufferFillStream | Stream to provide more data |
waveOutLock | Lock to protect WaveOut API's from being called on >1 thread |
◆ ~WaveOutBuffer()
NAudio.Wave.WaveOutBuffer.~WaveOutBuffer |
( |
| ) |
|
|
inlineprivate |
Finalizer for this wave buffer.
◆ Dispose() [1/2]
void NAudio.Wave.WaveOutBuffer.Dispose |
( |
| ) |
|
|
inline |
Disposes of the managed and unmanaged resources used by the WaveOut device.
- Parameters
-
disposing | A boolean value indicating whether to dispose of managed resources. |
This method releases the managed resources if disposing is true. It also releases the unmanaged resources including the allocated headers and buffers used by the WaveOut device.
◆ Dispose() [2/2]
void NAudio.Wave.WaveOutBuffer.Dispose |
( |
bool | disposing | ) |
|
|
inlineprotected |
Releases resources held by this WaveBuffer.
◆ OnDone()
bool NAudio.Wave.WaveOutBuffer.OnDone |
( |
| ) |
|
|
inline |
Reads data from the wave stream, writes it to the output, and returns a boolean value indicating whether the operation is successful.
- Returns
- True if data is successfully read and written to the output; otherwise, false.
This method locks the wave stream to read data into the buffer and then writes the data to the output. If no data is read from the wave stream, it returns false. The method also ensures that any remaining buffer space is filled with zeros before writing to the output.
◆ WriteToWaveOut()
void NAudio.Wave.WaveOutBuffer.WriteToWaveOut |
( |
| ) |
|
|
inlineprivate |
Writes the audio data to the WaveOut device for playback.
This method writes the audio data to the WaveOut device for playback. It locks the waveOutLock to ensure thread safety and then calls the WaveInterop.waveOutWrite method to write the audio data to the device using the specified header . If an error occurs during the write operation, a MmException is thrown with details about the specific error. After writing the data, this method ensures that the current object is kept alive by calling GC.KeepAlive to prevent premature garbage collection.
◆ buffer
readonly byte [] NAudio.Wave.WaveOutBuffer.buffer |
|
private |
◆ bufferSize
readonly Int32 NAudio.Wave.WaveOutBuffer.bufferSize |
|
private |
◆ hBuffer
GCHandle NAudio.Wave.WaveOutBuffer.hBuffer |
|
private |
◆ header
readonly WaveHeader NAudio.Wave.WaveOutBuffer.header |
|
private |
◆ hHeader
GCHandle NAudio.Wave.WaveOutBuffer.hHeader |
|
private |
◆ hThis
GCHandle NAudio.Wave.WaveOutBuffer.hThis |
|
private |
◆ hWaveOut
IntPtr NAudio.Wave.WaveOutBuffer.hWaveOut |
|
private |
◆ waveOutLock
readonly object NAudio.Wave.WaveOutBuffer.waveOutLock |
|
private |
◆ waveStream
◆ BufferSize
int NAudio.Wave.WaveOutBuffer.BufferSize |
|
get |
The buffer size in bytes.
◆ InQueue
bool NAudio.Wave.WaveOutBuffer.InQueue |
|
get |
Whether the header's in queue flag is set.
The documentation for this class was generated from the following file:
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/Plugins/LiveMicrophone/lib/NAudio.WinMM/WaveOutBuffer.cs