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

Public Member Functions

 AcmStreamHeader (IntPtr streamHandle, int sourceBufferLength, int destBufferLength)
 
void Reposition ()
 Sets the flag 'firstTime' to true, indicating that the repositioning is being performed for the first time.
 
int Convert (int bytesToConvert, out int sourceBytesConverted)
 Converts the specified number of bytes using the Audio Compression Manager (ACM) and returns the number of bytes converted.
 
void Dispose ()
 Disposes of the allocated resources.
 

Protected Member Functions

virtual void Dispose (bool disposing)
 

Properties

byte[] SourceBuffer [get, private set]
 
byte[] DestBuffer [get, private set]
 

Private Member Functions

void Prepare ()
 Prepares the audio stream header for processing.
 
void Unprepare ()
 Unprepares the audio stream for conversion by updating the stream header and unpreparing the header using ACM interop.
 
 ~AcmStreamHeader ()
 

Private Attributes

AcmStreamHeaderStruct streamHeader
 
GCHandle hSourceBuffer
 
GCHandle hDestBuffer
 
IntPtr streamHandle
 
bool firstTime
 
bool disposed = false
 

Constructor & Destructor Documentation

◆ AcmStreamHeader()

NAudio.Wave.Compression.AcmStreamHeader.AcmStreamHeader ( IntPtr streamHandle,
int sourceBufferLength,
int destBufferLength )
inline

◆ ~AcmStreamHeader()

NAudio.Wave.Compression.AcmStreamHeader.~AcmStreamHeader ( )
inlineprivate
Here is the call graph for this function:

Member Function Documentation

◆ Convert()

int NAudio.Wave.Compression.AcmStreamHeader.Convert ( int bytesToConvert,
out int sourceBytesConverted )
inline

Converts the specified number of bytes using the Audio Compression Manager (ACM) and returns the number of bytes converted.

Parameters
bytesToConvertThe number of bytes to convert.
sourceBytesConvertedWhen this method returns, contains the actual number of bytes converted from the source buffer.
Returns
The number of bytes converted from the destination buffer.

This method prepares for the conversion, sets the source buffer length, and performs the ACM stream conversion using the specified flags. It then checks if the codec has changed the destination buffer length and updates the sourceBytesConverted parameter with the actual number of bytes converted. Finally, it unprepares for the conversion and returns the number of bytes converted from the destination buffer.

Exceptions
MmExceptionThrown when an error occurs during the ACM stream conversion.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dispose() [1/2]

void NAudio.Wave.Compression.AcmStreamHeader.Dispose ( )
inline

Disposes of the allocated resources.

Parameters
disposingA boolean value indicating whether the method is being called from the Dispose method or the finalizer.

This method releases the allocated resources if disposing is true. The allocated resources include the source buffer, destination buffer, and their corresponding handles. Once the resources are disposed, the method sets the disposed flag to true.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dispose() [2/2]

virtual void NAudio.Wave.Compression.AcmStreamHeader.Dispose ( bool disposing)
inlineprotectedvirtual

◆ Prepare()

void NAudio.Wave.Compression.AcmStreamHeader.Prepare ( )
inlineprivate

Prepares the audio stream header for processing.

This method prepares the audio stream header for processing by setting the structure size and buffer pointers. It also calls the acmStreamPrepareHeader function from the AcmInterop library to prepare the audio stream header for processing.

Exceptions
MmExceptionThrown when an error occurs during the preparation of the audio stream header.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Reposition()

void NAudio.Wave.Compression.AcmStreamHeader.Reposition ( )
inline

Sets the flag 'firstTime' to true, indicating that the repositioning is being performed for the first time.

Here is the caller graph for this function:

◆ Unprepare()

void NAudio.Wave.Compression.AcmStreamHeader.Unprepare ( )
inlineprivate

Unprepares the audio stream for conversion by updating the stream header and unpreparing the header using ACM interop.

This method updates the source and destination buffer lengths and pointers in the stream header, then unprepares the header using ACM interop. If an error occurs during unpreparing the header, a MmException is thrown with the corresponding error message.

Exceptions
MmExceptionThrown when an error occurs during unpreparing the header.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ disposed

bool NAudio.Wave.Compression.AcmStreamHeader.disposed = false
private

◆ firstTime

bool NAudio.Wave.Compression.AcmStreamHeader.firstTime
private

◆ hDestBuffer

GCHandle NAudio.Wave.Compression.AcmStreamHeader.hDestBuffer
private

◆ hSourceBuffer

GCHandle NAudio.Wave.Compression.AcmStreamHeader.hSourceBuffer
private

◆ streamHandle

IntPtr NAudio.Wave.Compression.AcmStreamHeader.streamHandle
private

◆ streamHeader

AcmStreamHeaderStruct NAudio.Wave.Compression.AcmStreamHeader.streamHeader
private

Property Documentation

◆ DestBuffer

byte [] NAudio.Wave.Compression.AcmStreamHeader.DestBuffer
getprivate set

◆ SourceBuffer

byte [] NAudio.Wave.Compression.AcmStreamHeader.SourceBuffer
getprivate set

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