-
Notifications
You must be signed in to change notification settings - Fork 0
4: Audio‐Only Usage
Jon McGuire edited this page Jan 26, 2024
·
2 revisions
(TODO: Provide a more detailed explanation. This was moved from the original quick-and-dirty README.)
It is possible to use the audio portion separately:
- Create an
EyeCandyCaptureConfig
object to define audio capture parameters - Create an
AudioCaptureBase
object by calling the staticFactory
method - For post-processing, assign an
AudioProcessingRequirements
struct toaudio.Requirements
- Create an
Action
-style callback (no arguments, returnsvoid
) - Create a
CancellationTokenSource
- Start capturing with
Task.Run(() => audio.Capture(callback, cancellationToken))
- In the callback, reference the sample and processed data arrays in
audio.Buffers
- Stop capturing:
- Cancel the token
-
await
theTask
returned from theTask.Run
invocation - Call
Dispose
(or re-start capture)
The "Peaks" demo is a good example of this (purely console-based analysis of data maximums).