Audio overview - musescore/MuseScore GitHub Wiki

Audio system

audio_overview

We have three layers:

  • Main application - here public client interface for put data and controls.
  • Audio Worker - here generate and mix audio data.
  • Audio Driver - here requesting audio data to play

All layers work in separate threads.
We need to make sure that each part of the system works only in its thread and, ideally, there is no access to the same object from different threads, in order to avoid problems associated with access data thread safety.

Objects from different layers (threads) must interact only through:

  • Rpc (remote call procedure) channel - controls and pass midi data
  • AudioBuffer - pass audio data from worker to driver for play

AudioEngine is in the worker and operates only with the buffer, in fact, it knows nothing about the data consumer, about the audio driver.

⚠️ **GitHub.com Fallback** ⚠️