Class WavStream
An in memory stream representing a 16 bit, 1 channel, PCM, 8000hz or 16000hz wav file. Provides the ability to return just the raw data without the wav header
Inherited Members
Namespace: ivrToolkit.Core.Util
Assembly: ivrToolkit.Core.dll
Syntax
public class WavStream : MemoryStream, IAsyncDisposable, IDisposable, IEquatable<WavStream>
Constructors
| Edit this page View SourceWavStream(byte[])
Generates a WavStream from a byte array
Declaration
public WavStream(byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
byte[] | buffer | The byte array representing a wav file in the correct format |
Exceptions
Type | Condition |
---|---|
VoiceException | Thrown if the wav file is not in the correct format |
Properties
| Edit this page View SourceWavFormat
The metadata of the wav file.
Declaration
public WaveFormat WavFormat { get; }
Property Value
Type | Description |
---|---|
WaveFormat |
WavHeaderLength
The number of bytes the wav header takes up.
Declaration
public int WavHeaderLength { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceEquals(WavStream)
Two wavStreams are identical if they contain the same bytes
Declaration
public bool Equals(WavStream other)
Parameters
Type | Name | Description |
---|---|---|
WavStream | other | The other WavStream to compare with |
Returns
Type | Description |
---|---|
bool | True if the bytes are the same length and content is the same |
GetAudioDataOnly()
Returns the raw wav data without the header
Declaration
public MemoryStream GetAudioDataOnly()
Returns
Type | Description |
---|---|
MemoryStream |