Question about sample rates using the Daisy Pod

Hello all, I am working on a delay effect using the daisy pod and it has been working great so far. However, I wanted to try and mess with the sample rate to change the pitch and quality of the sound. I’ve had some success using the following:

      DAISY.StopAudio();
      SaiHandle::Config sai_config;
      sai_config.sr = SaiHandle::Config::SampleRate::SAI_16KHZ; (or 32KHZ, or 8KHZ etc...)
      DAISY.SetAudioSampleRate(sai_config.sr);
      DAISY.StartAudio(AudioCallback);

This has allowed me to change the sample rate dynamically. However I have a strange problem. I have only been able to move the sample rate up. So for example start at 8KHZ and move from 8KHZ to 16KHZ and to 32KHZ. However if I try to jump back down from 32KHZ to 16KHZ my daisy freezes up. Also weirdly enough the only time I have been able to move the sample rate down, is from 16KHZ to 8KHZ. Any ideas on a work around?

Hey Miles!

That’s an interesting issue indeed. From my understanding, it’s not recommended to dynamically change the sample rate like that anyway.

Since we only have set of standard sample rates as of now regardless, I recommend checking out decimator in DaisySP to get that downsample effect (DaisySP/decimator.cpp at master · electro-smith/DaisySP · GitHub).

thank you for the reply! I will look into trying this out instead of the sample rate changes. Do you think that dynamic audio sample rate change will ever be available on the Daisy?

Glad to help! This will be the solution/workaround in the meantime.

And thank you for the suggestion! I believe we would first want to add the feature to be able to use non-standard sample rates (so being able to use values between 16kHz and 8kHz for example). I can bring this up when a topic of sample rate pops up :slight_smile:

1 Like