> For the complete documentation index, see [llms.txt](https://docs.lmms.io/developer-guides/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lmms.io/developer-guides/core/how-lmms-renders-audio.md).

# The audio rendering engine of LMMS

## Audio engine and audio rendering

LMMS has a class for audio rendering, named `AudioEngine`. `AudioEngine::renderNextBuffer` contains the main functionality of `AudionEngine`. Major works that the function does:

1. Remove all finished `PlayHandle`s
2. Call `Song::processNextBuffer` to play songs and add `PlayHandle`s
3. Queue jobs for `AudioEngineWorkerThread` and wait for worker threads (`PlayHandle`, effects in instrument tracks/sample tracks, FX mixing)
4. Call `runChangesInModel` to process pending non-automated changes

### Mixer worker threads

`AudioEngineWorkerThread` processes `ThreadableJob`s queued in `AudioEngine::renderNextBuffer`. There are three kinds of jobs that `AudioEngineWorkerThread` runs.

* `AudioPort`: Processes intermediate audio signals(Currently used for audio effects for tracks)
* `FxChannel`: Processes audio effects per FX channel
* `PlayHandle`: Plays notes/instruments/audio samples
