File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
shared-module/audiodelays Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -313,20 +313,22 @@ audioio_get_buffer_result_t audiodelays_pitch_shift_get_buffer(audiodelays_pitch
313313 hword_buffer [i ] = (uint8_t )mixed ^ 0x80 ;
314314 }
315315 }
316+
317+ if (self -> base .channel_count == 1 || buf_offset ) {
318+ // Increment window buffer write pointer
319+ self -> window_index ++ ;
320+ if (self -> window_index >= window_size ) self -> window_index = 0 ;
321+
322+ // Increment overlap buffer pointer
323+ if (overlap_size ) {
324+ self -> overlap_index ++ ;
325+ if (self -> overlap_index >= overlap_size ) self -> overlap_index = 0 ;
326+ }
316327
317- // Increment window buffer write pointer
318- self -> window_index ++ ;
319- if (self -> window_index >= window_size ) self -> window_index = 0 ;
320-
321- // Increment overlap buffer pointer
322- if (self -> overlap_len ) {
323- self -> overlap_index ++ ;
324- if (self -> overlap_index >= overlap_size ) self -> overlap_index = 0 ;
328+ // Increment window buffer read pointer by rate
329+ self -> read_index += self -> read_rate ;
330+ if (self -> read_index >= window_size << PITCH_READ_SHIFT ) self -> read_index -= window_size << PITCH_READ_SHIFT ;
325331 }
326-
327- // Increment window buffer read pointer by rate
328- self -> read_index += self -> read_rate ;
329- if (self -> read_index >= window_size << PITCH_READ_SHIFT ) self -> read_index -= window_size << PITCH_READ_SHIFT ;
330332 }
331333
332334 // Update the remaining length and the buffer positions based on how much we wrote into our buffer
You can’t perform that action at this time.
0 commit comments