huynhsontung / Screenbox

LibVLC-based media player for the Universal Windows Platform
GNU General Public License v3.0
1.11k stars 44 forks source link

feat: use AudioGraph to output and process audio #363

Open huynhsontung opened 7 months ago

huynhsontung commented 7 months ago

Use AudioGraph to handle audio output from VLC using audio callbacks. This change allows us to potentially extract audio data for additional post-processing and filtering, or external use cases such as audio visualizations.

As the AudioFrameInputNode has a limited buffer, a circular buffer is used to transport and package audio data from VLC into audio frames. VLC and AudioGraph run on separate threads, interacting with the buffer asynchronously. Due to the complex nature of the producer-consumer model, some audio issues can occur, including delay, click, or hitch.