Skip to content

Commit

Permalink
Bug Fix: Hopefully fix flickering visualizations
Browse files Browse the repository at this point in the history
Now buffer twice as much audio as would be requested for a single
visualization PCM/FFT chunk, which should hopefully prevent it from
flickering due to running out of audio because of too low latency.

Now it buffers up to two chunks at the current hard coded visualization
sample rate, which works out to about 186 milliseconds.

Signed-off-by: Christopher Snowhill <[email protected]>
  • Loading branch information
kode54 committed Feb 16, 2025
1 parent 44b8aa0 commit 023d7e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Audio/Chain/BufferChain.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ - (BOOL)buildChain {
downmixNode = [[DSPDownmixNode alloc] initWithController:self previous:hrtfNode latency:0.03];
if(!downmixNode) return NO;

// Approximately five frames
visualizationNode = [[VisualizationNode alloc] initWithController:self previous:downmixNode latency:5.0 / 60.0];
// Approximately double the chunk size for Vis at 44100Hz
visualizationNode = [[VisualizationNode alloc] initWithController:self previous:downmixNode latency:8192.0 / 44100.0];
if(!visualizationNode) return NO;

finalNode = visualizationNode;
Expand Down

0 comments on commit 023d7e2

Please sign in to comment.