Click or drag to resize
Accord.NET (logo)

AudioDecoder Class

Audio decoder to decode different custom audio file formats.
Inheritance Hierarchy
SystemObject
  Accord.Audio.FormatsAudioDecoder

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

The AudioDecoder type exposes the following members.

Constructors
  NameDescription
Public methodAudioDecoder
Initializes a new instance of the AudioDecoder class
Top
Methods
  NameDescription
Public methodStatic memberDecodeFromFile(String)
Decode a signal from the specified file.
Public methodStatic memberDecodeFromFile(String, FrameInfo)
Decode a signal from the specified file.
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 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
Remarks

The class represent a help class, which simplifies decoding of audio files finding appropriate image decoder automatically (using list of registered audio decoders). Instead of using required audio decoder directly, users may use this class, which will find required decoder by file's extension.

By default the class will query all referenced assemblies for types that are marked with the FormatDecoderAttribute. If the user would like to implement a new decoder, all that is necessary is to mark a new class with the FormatDecoderAttribute and make it implement the IAudioDecoder interface.

Examples
string filename = Path.Combine(basePath, "lena.pgm");

// One way to decode the image explicitly is to use
Bitmap image1 = ImageDecoder.DecodeFromFile(filename);

// However, you could also obtain the same effect using
Bitmap image2 = Accord.Imaging.Image.FromFile(filename);
See Also