Skip to content

Commit

Permalink
reset interpolation state on pause / play
Browse files Browse the repository at this point in the history
  • Loading branch information
grz0zrg committed Apr 5, 2021
1 parent f0b779d commit 3198305
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ static int audioCallback(float **inputBuffer, float **outputBuffer, unsigned lon
if (audio_thread_state == FAS_AUDIO_DO_PAUSE) {
last_gain_lr = curr_synth.settings->gain_lr;

curr_synth.lerp_t = 0.0;

audio_thread_state = FAS_AUDIO_PAUSE;
} else if (audio_thread_state == FAS_AUDIO_DO_PLAY) {
curr_synth.lerp_t = 0.0;
Expand All @@ -322,6 +324,8 @@ static int audioCallback(float **inputBuffer, float **outputBuffer, unsigned lon

last_gain_lr = curr_synth.settings->gain_lr;

curr_synth.lerp_t = 0.0;

audio_thread_state = FAS_AUDIO_PAUSE;
}

Expand Down

0 comments on commit 3198305

Please sign in to comment.