festival
festival copied to clipboard
`Audio` rewrite
What
The code for Audio
is too entwined.
The major roles Audio
plays is:
- Audio decoding/demuxing
-
Kernel
signal handling - OS media control + metadata handling
-
AUDIO_STATE
state & logic management
Problems
The cause of most of these issues is the state + logic handling of AUDIO_STATE
being half-baked into Audio
:
- There's tons of code duplication
- There's potential deadlocks all over the place
- It's hard to read and maintain
Goal
"Given this signal, what will happen to the audio state?"
This is really hard to answer as it stands, because everything is so intertwined.
The goal should be small finite state machine, which AUDIO_STATE
really is at its core.
The methods should be tied to the global AUDIO_STATE
, not the Audio
thread.
https://github.com/hinto-janai/sansan is basically a re-write of src/audio
, extracted out into its own dedicated library.