Changing speed of an audio output on the Arduino uno r4

Hi, I am trying to change the playback speed of a wave file that is played from a file on a SD card straight to the dac through a analog audio stream. I am using the analog audio tools library. Changing the pitch and speed is fine. I figured out that setting the sample rate given to the analogaudiostream in setup to a lower or higher value changes the speed, but I can't figure out how to change the pitch/speed while the songs playing.
The wave file is a header less mono wave with 8 bit unsigned integer samples and 8000 samples per second. I already have a circuit and code that outputs the wave to speaker.
All help appreciated.

Think you need to post up your code do we can see what you are trying to.

There will be buffering of the data involved in your audio processing. Examine how the buffering is done and where it is done in the data stream. Probably the "speed" you want is in emptying the buffer going to the A/D device.

Use resampling for runtime playback speed control. Keep the DAC output rate fixed at 8000 Hz. Change the resampling ratio during playback. This changes speed and pitch together.