> 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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lmms.io/developer-guides/core/how-lmms-renders-audio.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
