Click or drag to resize

WaveFile Class

Represents a waveform audio format file (WAV).
Inheritance Hierarchy
SystemObject
  GSF.MediaWaveFile
    GSF.Media.MusicSong

Namespace: GSF.Media
Assembly: GSF.Media (in GSF.Media.dll) Version: 2.4.218-beta
Syntax
public class WaveFile
View Source

The WaveFile type exposes the following members.

Constructors
 NameDescription
Public methodWaveFile Creates a new empty in-memory wave file using standard CD quality settings.
Public methodWaveFile(Int32, Int16, Int16) Creates a new empty in-memory wave file in Pulse Code Modulation (PCM) audio format.
Public methodWaveFile(SampleRate, BitsPerSample, DataChannels) Creates a new empty in-memory wave file in Pulse Code Modulation (PCM) audio format.
Public methodWaveFile(Int32, Int16, Int16, UInt16) Creates a new empty in-memory wave file in specified audio format.
Public methodWaveFile(RiffHeaderChunk, WaveFormatChunk, WaveDataChunk, ListInfoChunk) Creates a new empty in-memory wave file using existing constituent chunks.
Public methodWaveFile(SampleRate, BitsPerSample, DataChannels, WaveFormat) Creates a new empty in-memory wave file in specified audio format.
Top
Properties
 NameDescription
Public propertyAmplitudeScalar Returns the amplitude scalar for the given bits per sample of the WaveFile (i.e., maximum value for given BitsPerSample).
Public propertyAudioFormat Gets or sets audio format used by the WaveFile.
Public propertyAudioLength Gets calculated audio length.
Public propertyBitsPerSample Gets or sets number of bits-per-sample in the WaveFile.
Public propertyBlockAlignment Gets or sets the block size of a complete sample of data (i.e., samples for all channels of data at one instant in time).
Public propertyByteRate Gets or sets the byte rate used for buffer estimation.
Public propertyChannels Gets or sets number of audio channels in the WaveFile.
Public propertyDataChunk Gets or sets the WaveDataChunk of this WaveFile.
Public propertyExtraParameters Gets or sets any extra parameters defined in the format header of the WaveFile.
Public propertyExtraParametersSize Gets the size of the ExtraParameters buffer, if defined.
Public propertyFormatChunk Gets or sets the WaveFormatChunk of this WaveFile.
Public propertyHeaderChunk Gets or sets the RiffHeaderChunk of this WaveFile.
Public propertyInfoChunk Gets the ListInfoChunk of this WaveFile.
Public propertyInfoStrings Gets list of info strings available in this WaveFile if any were available during load; otherwise an empty dictionary.
Public propertySampleBlocks Accesses each individual block of sample data indexed by time.
Public propertySampleRate Gets or sets the sample rate (i.e., the number of samples per second) defined in the WaveFile.
Top
Methods
 NameDescription
Public methodAddSample Add the sample to the wave file.
Public methodAddSampleBlock Adds a block of samples in native format to the wave file (e.g., if BitsPerSample = 16, parameters need to be Int16 values). Note that LittleBinaryValue parameter type is implicitly castable to common native types, including floating points.
Public methodAddSamples Adds a series of samples, one per channel, to the wave file.
Public methodStatic memberAppend Appends wave files together, one after another, into a single file.
Public methodCastSample Casts sample value to its equivalent native type based on defined BitsPerSample and AudioFormat.
Public methodClone Creates a deeply cloned copy of the WaveFile.
Public methodStatic memberCloneSampleBlock Performs a deep clone of all the channel samples in a sample block.
Public methodStatic memberCombine(WaveFile) Combines wave files together, all starting at the same time, into a single file. This has the effect of playing two sound tracks simultaneously.
Public methodStatic memberCombine(WaveFile, Double) Combines wave files together, all starting at the same time, into a single file. This has the effect of playing two sound tracks simultaneously.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetSampleTypeCode Determines sample data type code based on defined BitsPerSample and AudioFormat.
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodStatic memberLoad(Stream, Boolean) Creates a new in-memory wave loaded from an existing wave audio stream.
Public methodStatic memberLoad(String, Boolean) Creates a new in-memory wave loaded from an existing wave file.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodPlay Plays the wave file using SoundPlayer.
Public methodReverse Reverses the data samples in the wave file.
Public methodSave(Stream) Saves wave file to the specified stream.
Public methodSave(String) Saves wave file to the specified file name.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
See Also