AudioCaptureDevice Class |
Namespace: Accord.DirectSound
The AudioCaptureDevice type exposes the following members.
Name | Description | |
---|---|---|
AudioCaptureDevice |
Initializes a new instance of the AudioCaptureDevice class.
| |
AudioCaptureDevice(Guid) |
Initializes a new instance of the AudioCaptureDevice class.
| |
AudioCaptureDevice(AudioDeviceInfo) |
Initializes a new instance of the AudioCaptureDevice class.
| |
AudioCaptureDevice(Guid, String) |
Initializes a new instance of the AudioCaptureDevice class.
|
Name | Description | |
---|---|---|
BytesReceived |
Received bytes count.
| |
CanSeek |
Gets whether this audio source supports seeking.
| |
Channels |
Gets the number of audio channels captured by
the device. Currently, only a single channel
is supported.
| |
DesiredFrameSize |
Gets or sets the desired frame size.
| |
Format |
Gets or sets the sample format used by the device.
| |
FramesReceived |
Received frames count.
| |
IsRunning |
State of the audio source.
| |
SampleRate |
Gets or sets the desired sample rate for this capturing device.
| |
Source |
Audio source.
| |
UserData |
User data.
|
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
AudioCaptureDevice 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.) | |
OnNewFrame |
Notifies client about new block of frames.
| |
Seek |
This source does not support seeking.
| |
SignalToStop |
Signals audio source to stop its work.
| |
Start |
Start audio source.
| |
Stop |
Stop audio source.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
WaitForStop |
Wait for audio source has stopped.
|
Name | Description | |
---|---|---|
AudioSourceError |
Audio source error event.
| |
NewFrame |
New frame event.
|
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 captures audio data obtained from a local audio capture device such as the microphone. The audio is captured using DirectSound through SlimDX.
For instructions on how to list capture devices, please see the AudioDeviceCollection documentation page.
Sample usage:
// Create default capture device AudioCaptureDevice source = new AudioCaptureDevice(); // Specify capturing options source.DesiredFrameSize = 4096; source.SampleRate = 22050; // 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 // ... }
For more details regarding usage, please check one of the Audio sample applications accompanying the framework.