Click or drag to resize
Accord.NET (logo)

WaveEncoder Class

Wave audio file encoder.
Inheritance Hierarchy
SystemObject
  Accord.Audio.FormatsWaveEncoder

Namespace:  Accord.Audio.Formats
Assembly:  Accord.Audio.DirectSound (in Accord.Audio.DirectSound.dll) Version: 3.8.0
Syntax
public class WaveEncoder : IAudioEncoder
Request Example View Source

The WaveEncoder type exposes the following members.

Constructors
  NameDescription
Public methodWaveEncoder
Constructs a new Wave encoder.
Public methodWaveEncoder(FileStream)
Constructs a new Wave encoder.
Public methodWaveEncoder(Stream)
Constructs a new Wave encoder.
Public methodWaveEncoder(String)
Constructs a new Wave encoder.
Top
Properties
  NameDescription
Public propertyAverageBitsPerSecond
Gets the average bits per second of the underlying Wave stream.
Public propertyBitsPerSample
Gets the bits per sample of the underlying Wave stream.
Public propertyBytes
Gets the total number of bytes written by this Wave encoder.
Public propertyChannels
Gets the number of channels of the active Wave stream.
Public propertyDuration
Gets the total time span duration (in milliseconds) written by this encoder.
Public propertyFormat
Gets the sample format used by the encoder.
Public propertyFrames
Gets the total number of frames written by this Wave encoder.
Public propertySampleRate
Gets the sample rate of the underlying Wave stream.
Public propertySamples
Gets the total number of samples written by this Wave encoder.
Public propertyStream
Gets the underlying Wave stream.
Top
Methods
  NameDescription
Public methodClose
Closes the underlying stream.
Public methodEncode
Encodes the Wave stream into a Signal object.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOpen(FileStream)
Opens the specified stream.
Public methodOpen(Stream)
Open specified stream.
Public methodOpen(String)
Open specified stream.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodHasMethod
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)
Public Extension MethodIsEqual
Compares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices.
(Defined by Matrix.)
Public Extension MethodTo(Type)Overloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Public Extension MethodToTOverloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Top
Examples
// Create a stream to hold our encoded audio
MemoryStream destinationStream = new MemoryStream();

// Create a encoder for the destination stream
WaveEncoder encoder = new WaveEncoder(destinationStream);

// Encode the signal to the destination stream
encoder.Encode(sourceSignal);
See Also