stelatoris / XTronical-I2S-Audio-with-SD

6 stars 1 forks source link

LoadWavFile for more than 5 wav files, is not working #4

Closed rshashikanth closed 11 months ago

rshashikanth commented 11 months ago

I am able to use LoadWavFile(), for only upto 5 files and plays flawlessly, but the 6th file onwards, it doesnt play

Please help!

stelatoris commented 11 months ago

I am able to use LoadWavFile(), for only upto 5 files and plays flawlessly, but the 6th file onwards, it doesnt play

Please help!

Did you play the 5 files all at the same time? What were the conditions when this happens?

rshashikanth commented 11 months ago

Thank you so much for your reply

No I am not playing at the same time, max I will play 2 files at the same time

clash5.LoadWavFile();
clash6.LoadWavFile();
clash7.LoadWavFile();
startup1.LoadWavFile();
ignition.LoadWavFile();
hum.LoadWavFile();

In this there are 6 files, even when I shuffle them, the last one is not playing, but others work well

But serial monitor Serial.println(I2SAudio.AlreadyPlaying(&hum)); //the last one

gives me `1', which means it is playing

Please help me, this is a awesome library, I am even ready to pay for your help

stelatoris commented 11 months ago

Thank you so much for your reply

No I am not playing at the same time, max I will play 2 files at the same time

clash5.LoadWavFile();
clash6.LoadWavFile();
clash7.LoadWavFile();
startup1.LoadWavFile();
ignition.LoadWavFile();
hum.LoadWavFile();

In this there are 6 files, even when I shuffle them, the last one is not playing, but others work well

But serial monitor Serial.println(I2SAudio.AlreadyPlaying(&hum)); //the last one

gives me `1', which means it is playing

Please help me, this is a awesome library, I am even ready to pay for your help

I can't tell until I look at it. I will try to next week as I'm very busy this week. Are you trying to use it for an RC car/airplane?

rshashikanth commented 11 months ago

Thanks, I am using it for a custom lightsaber

Peter-67 commented 11 months ago

The number of open files is limited by the sd.h lib of the ESP32 by 5, but you can increase the max. number of files.

rshashikanth commented 11 months ago

The number of open files is limited by the sd.h lib of the ESP32 by 5, but you can increase the max. number of files.

Awesome, Thanks a ton

I modified this line, and made max_files=50, works like a charm

bool begin(uint8_t ssPin=SS, SPIClass &spi=SPI, uint32_t frequency=4000000, const char * mountpoint="/sd", uint8_t max_files=50, bool format_if_empty=false);

stelatoris commented 11 months ago

Thanks, I am using it for a custom lightsaber

That's awesome! I would love to make one for the kids. Keep me updated.

rshashikanth commented 11 months ago

Thanks, I am using it for a custom lightsaber

That's awesome! I would love to make one for the kids. Keep me updated.

Sure, will post link after completion