WaveFileAudioSource Class |
Namespace: Accord.DirectSound
The WaveFileAudioSource type exposes the following members.
Name | Description | |
---|---|---|
WaveFileAudioSource(Stream) |
Constructs a new Wave file audio source.
| |
WaveFileAudioSource(String) |
Constructs a new Wave file audio source.
|
Name | Description | |
---|---|---|
BytesReceived |
Gets the quantity of bytes received.
| |
CanSeek |
Gets whether the current source supports seeking.
| |
Channels |
Gets the number of audio channels in the wave file.
| |
DesiredFrameSize |
Gets or sets the desired frame size to use when reading this source.
| |
FramesReceived |
Gets the quantity of frames received.
| |
IsRunning |
Gets whether this source is active or not.
| |
SampleRate |
Gets the sampling rate for this source.
| |
Source |
Gets or sets the file source path.
| |
UserData |
Gets or sets a user-defined tag associated with this object.
|
Name | Description | |
---|---|---|
Dispose |
Performs application-defined tasks associated with
freeing, releasing, or resetting unmanaged resources.
| |
Dispose(Boolean) |
Releases unmanaged and - optionally - managed resources
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize |
Releases unmanaged resources and performs other cleanup operations before the
WaveFileAudioSource is reclaimed by garbage collection.
(Overrides ObjectFinalize.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Seek |
Navigates to a given position within the source.
| |
SignalToStop |
Signals the source to stop.
| |
Start |
Starts reading from the source.
| |
Stop |
Stops the source.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
WaitForStop |
Blocks the calling thread until the source has stopped.
|
Name | Description | |
---|---|---|
AudioSourceError |
Event raised when an error occurs in the audio source.
| |
NewFrame |
Event raised when a new frame has arrived.
|
Name | Description | |
---|---|---|
HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |
IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |
To(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.) | |
ToT | 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.) |
This audio source reads audio samples from Wave files. Internally, it uses the WaveDecoder class to automatically decode Wave files into audio signals.
Sample usage:
// Create the Wave file audio source WaveFileAudioSource source = new WaveFileAudioSource("audiofile.wav"); // Specify the callback function which will be // called once a sample is completely available source.NewFrame += source_NewFrame; // Start capturing source.Start(); // ... // The callback function should determine what // should be done with the samples being caught private void source_NewFrame(object sender, NewFrameEventArgs eventArgs) { // Read current frame... Signal s = eventArgs.Signal; // Process/play/record it // ... }