# Processing real-time streaming audio, controlled by a GUI

**URL:** <https://discourse.julialang.org/t/processing-real-time-streaming-audio-controlled-by-a-gui/96692>\
**Category:** Signal and Image Processing\
**Tags:** dsp, gui, audio\
**Created:** [March 28, 2023, 3:06am UTC](https://discourse.julialang.org/t/processing-real-time-streaming-audio-controlled-by-a-gui/96692 "2023-03-28T03:06:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cdevane](https://avatars.discourse-cdn.com/v4/letter/c/5e9695/32.png) [@cdevane](https://discourse.julialang.org/u/cdevane)\
**Post date:** [March 28, 2023, 3:06am UTC](https://discourse.julialang.org/t/processing-real-time-streaming-audio-controlled-by-a-gui/96692/1 "2023-03-28T03:06:44Z")

</div>

I’m a relative newcomer to Julia.

I’d like to build an app that processes an audio stream in real time, with processing parameters controlled from a GUI. I’m looking for suggestions on how to approach this, or better yet, pointers to examples if they exist.

My first thought is:

- the real-time loop runs in a separate thread, using PortAudio.jl for i/o, with Julia code in the middle to process the stream.
- the GUI runs in the main Julia thread, and sends control information (eg, “stop”) and changes to processing parameters to the real-time loop through some safe mechanism (RingBuffers.jl looks like a good candidate).

Thoughts?

thanks,  
Charlie

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [March 28, 2023, 3:29am UTC](https://discourse.julialang.org/t/processing-real-time-streaming-audio-controlled-by-a-gui/96692/2 "2023-03-28T03:29:55Z")

</div>

This talk does audio processing

[![](https://global.discourse-cdn.com/julialang/original/3X/1/8/187e48476d2551618de169bf3a1849572374ef6c.jpeg "Exploring audio circuits with ModelingToolkit.jl | George Gkountouras | JuliaCon 2022") ](https://www.youtube.com/watch?v=3DfVowNFI2c)

---

<div class="post-metadata">

**Author:** ![cdevane](https://avatars.discourse-cdn.com/v4/letter/c/5e9695/32.png) [@cdevane](https://discourse.julialang.org/u/cdevane)\
**Post date:** [March 30, 2023, 9:59pm UTC](https://discourse.julialang.org/t/processing-real-time-streaming-audio-controlled-by-a-gui/96692/3 "2023-03-30T21:59:36Z")

</div>

Thanks @jar1. They don’t have a GUI front end so it doesn’t solve my immediate problem. However, they address some questions I will be asking soon so thanks for pointing me to it.

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [March 30, 2023, 10:42pm UTC](https://discourse.julialang.org/t/processing-real-time-streaming-audio-controlled-by-a-gui/96692/4 "2023-03-30T22:42:42Z")

</div>

For GUI there are

- [GitHub - barche/QML.jl: Build Qt5 QML interfaces for Julia programs.](https://github.com/barche/QML.jl)
- [Home · Gtk.jl](https://juliagraphics.github.io/Gtk.jl/latest/)
- [GitHub - Gnimuc/CImGui.jl: Julia wrapper for cimgui](https://github.com/Gnimuc/CImGui.jl)

---

<div class="post-metadata">

**Author:** ![cdevane](https://avatars.discourse-cdn.com/v4/letter/c/5e9695/32.png) [@cdevane](https://discourse.julialang.org/u/cdevane)\
**Post date:** [April 21, 2023, 3:00am UTC](https://discourse.julialang.org/t/processing-real-time-streaming-audio-controlled-by-a-gui/96692/5 "2023-04-21T03:00:48Z")

</div>

Thanks. What I was primarily looking for is an example of the multithreading with one thread running a tight real time loop and one (or more) much lower priority such as, but not necessarily, graphics. Sorry I wasn’t more clear.

---

<div class="post-metadata">

**Author:** ![Ashwani\_Rathee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ashwani_rathee/32/49551_2.png) [@Ashwani\_Rathee](https://discourse.julialang.org/u/Ashwani_Rathee)\
**Post date:** [April 21, 2023, 6:24am UTC](https://discourse.julialang.org/t/processing-real-time-streaming-audio-controlled-by-a-gui/96692/6 "2023-04-21T06:24:37Z")

</div>

This will be a good introduction with basics of real time audio in julia all in Pluto and a good testing ground:

[![](https://global.discourse-cdn.com/julialang/original/3X/d/e/de3eb1962f8f6cd9cc669e2f3b005eb3f266d9df.jpeg "Spectrogram, Waveplot and Real Time Audio Inputs in Julia") ](https://www.youtube.com/watch?v=d9aIFFlJF-w)

I use multihreaded system with main thread for rendering and other thread for handle audio system in [GitHub - ashwani-rathee/Miner.jl: Voxel World Simulator written with Makie in Julia](https://github.com/ashwani-rathee/Miner.jl) , [https://github.com/ashwani-rathee/Miner.jl/blob/8b3c4c5dbb7c9cc0d3e7a22d6a536f9f2299849c/src/Miner.jl#L114](https://github.com/ashwani-rathee/Miner.jl/blob/8b3c4c5dbb7c9cc0d3e7a22d6a536f9f2299849c/src/Miner.jl#L114) so I might help with what you might be need if you can describe little more. I also sort of control the music player through GUI only. Example here of control through GUI: [https://youtu.be/S-uLTsE2wZg](https://youtu.be/S-uLTsE2wZg)
