Processing real-time streaming audio, controlled by a GUI

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

This talk does audio processing

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.

For GUI there are

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.

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

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/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

2 Likes