-
-
Notifications
You must be signed in to change notification settings - Fork 237
Performance
The framework is supporting quite a few scenarios. The default settings have been chosen to work well in avarage with most of the scenarios. You have quite a few options to tweak the performance for your individual case. A good starting point are the settings in the AudioConfig.h. You either can change the values directly in the AudioConfig.h or create a local AudioConfigLocal.h file. The most relevant settings are
- DEFAULT_BUFFER_SIZE
- I2S_BUFFER_SIZE
- I2S_BUFFER_COUNT
Please note that increasing the values might improve if the audio is breaking up. Reducing the values is reducing the delays!
The i2s buffer definition can also be changed programmatically in your sketch when you define your i2s config.
When you define the StreamCopy you can specify the buffer size in the constructor
StreamCopy(Print &to, Stream &from, int buffer_size=DEFAULT_BUFFER_SIZE);
When you define the AudioSourceSdFat you can define the speed in MHz in the constructor:
AudioSourceSdFat(const char* startFilePath = "/", const char* ext = ".mp3", int chipSelect = PIN_CS, int speedMHz = 2);
The URLStream uses it's own buffer to store the receviced (decoded) data. It is defined by
- DEFAULT_BUFFER_SIZE,
- URL_STREAM_BUFFER_COUNT
In this case it is advisable to increase the URL_STREAM_BUFFER_COUNT and e.g. keep the I2S_BUFFER_COUNT as small as possible!