Core class responsible for managing the state and playback of the currently selected track. The lifespan of this instance matches the lifespan of the IAudioStream it consumes. More...


Public Member Functions | |
| AudioEngine (IAudioStream audioStream, IAudioPlayer audioPlayer, IFftProcessor fftProcessor, IFreqDataReceiver? dataReceiver=null, List< PluginInstance >? audioPlugins=null) | |
| void | Run () |
| Uses start and forget to run asynchronous tasks of producing/consuming audio data. | |
| void | Pause () |
| Pauses both processes. | |
| void | Resume () |
| Resumes pipeline. | |
| void | Abort () |
| Force quits pipeline safely. | |
| void | SetEq (EqSettings settings) |
| Updates EQ settings based on received data. | |
| void | Dispose () |
| Safely gets rid of the engine when stream runs out. | |
Properties | |
| Task[] | Tasks [get] |
| Gets the currently running producer and consumer tasks. | |
| float | VolumeFactor [get, set] |
| Exposes volume factor (in ranges 0 to 1). | |
| List< PluginInstance >? | PluginList [get] |
| Returns all detected plugins inside the engine. | |
Private Member Functions | |
| void | AudioProducerProcess (CancellationToken token) |
| Core audio pipeline. Consumes data from the _audioStream and processes them. Pushes the result into a data structure for the audio consumer. | |
| void | AudioConsumerProcess (CancellationToken token) |
| Consumes processed data from the buffer and pushes it to the player. | |
| void | ShiftBuffers (AudioFrame nextFrame) |
| float[] | MixToMonoFromBuffer () |
| void | OverlapAddToBuffer (float[] monoIfftSamples) |
| float[] | GetOutputSamplesFromBuffer () |
| Complex[] | ApplyEq (Complex[] freqBins) |
| float[] | ScaleVolume (float[] samples) |
Static Private Member Functions | |
| static float[] | GenerateHannWindow (int size) |
Private Attributes | |
| readonly IAudioStream | _audioStream |
| readonly IFftProcessor | _fftProcessor |
| readonly IAudioPlayer | _audioPlayer |
| readonly? List< PluginInstance > | _audioPlugins |
| readonly? IFreqDataReceiver | _dataReceiver |
| Optional for rendering audio data. | |
| EqSettings | _eqSettings = new EqSettings() |
| float | _volumeFactor = 0.5f |
| readonly float[] | _hannWindow = GenerateHannWindow(FrameSize) |
| int | _channelCount |
| float[] | _inputBuffer = [] |
| float[] | _overlapAddBuffer = [] |
| float[] | _tailBuffer = [] |
| int | _writePos = 0 |
| BlockingCollection< AudioFrame > | _frameBuffer = new BlockingCollection<AudioFrame>(32) |
| Task | _producerTask |
| Task | _consumerTask |
| CancellationTokenSource? | _cancellationTokenSource |
| readonly ManualResetEventSlim | _pauseEvent = new ManualResetEventSlim(true) |
Static Private Attributes | |
| const int | FrameSize = 1024 |
| const int | HopSize = FrameSize / 2 |
Core class responsible for managing the state and playback of the currently selected track. The lifespan of this instance matches the lifespan of the IAudioStream it consumes.
|
inline |


|
inline |
Force quits pipeline safely.

|
inlineprivate |

|
inlineprivate |
Consumes processed data from the buffer and pushes it to the player.
| token |


|
inlineprivate |
Core audio pipeline. Consumes data from the _audioStream and processes them. Pushes the result into a data structure for the audio consumer.
| token | Token enabling cancellation of pipeline. |


|
inline |
Safely gets rid of the engine when stream runs out.

|
inlinestaticprivate |
|
inlineprivate |

|
inlineprivate |

|
inlineprivate |

|
inline |
Pauses both processes.

|
inline |
Resumes pipeline.


|
inline |
Uses start and forget to run asynchronous tasks of producing/consuming audio data.


|
inlineprivate |

| void FQLab.AudioEngine.SetEq | ( | EqSettings | settings | ) |
Updates EQ settings based on received data.
| settings | Immutable struct of settings from the GUI. |

|
inlineprivate |

|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Optional for rendering audio data.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
get |
Returns all detected plugins inside the engine.
|
get |
Gets the currently running producer and consumer tasks.
|
getset |
Exposes volume factor (in ranges 0 to 1).