-
-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't Load SD samples with maximilian #1689
Comments
Did you try with the provided example that is using the wav in the resource directory ? I think your example files are wrong: a length of 0 does not give you much! |
Thanks. Which is weird. I can list the content of the SD, but when loading the samples, something goes wrong. Would you have any lead on what could cause this ? I don't really know where to start here. |
Did you try a test sketch that confirms that reading of the file is working ? |
I only tested I can access the SD, by listing all files in the SD. |
If I remember right the functionality uses the ESP32 virtual file system and the related c file API. So I would not take any assumptions and test if you can open and read the file with fopen and fread. Maybe you should also check if beats.load() returns true |
Thanks for the directions ! I noted maximilian is using : While the sd_mmc file system uses:
I am not really familiar with filesystem stuff, but I guess I might not be in the right config to use ifstream ? |
hmm: try to make a read test using ifstream The constructor should open the file and the check if it is open (is_open()) should then return true... |
Just noticed that you forgot the prefix to specify the file system: when the file is in the root directory of the drive that you named /sdcard |
Actually this prefix was in my initial issue code. But yes, I'll test ifstream alone first and see. |
Problem Description
Description:
I cannot manage to read a sample from SD with maximilian. Acces to SD seems ok, but maximilian won't load it's content.
When printing the summury info, charactics are there, but content remains at zero. So of course it is not playing.
I do the following for loading:
sample1.load("/sdcard/pong.wav"); Serial.println(sample1.getSummary().c_str());
See serial output below:
Loading: ### /sdcard/pong.wav
Ch: 1, len: 0
Format: 1
Channels: 1
SampleRate: 11025
ByteRate: 11025
BlockAlign: 1
BitsPerSample: 8
Length: 0
I tried with different samples (mono). I tried short to very short samples, like 2kb to 60kb, which I would expect to work without any issue, not matter if I use PSRAM ?
I checked a bit how the load function works but can't find what is going wrong. The data seems to be red, but the last manipulation which manipulate the chunks to the "amplitude" variable which seems to be the final data to be played is not filled.
Issue might be esp32 related ? or am I missing some constraints on the sample type/format ? :
Device Description
Esp32-s3 N8R8 devkitC
Sketch
Other Steps to Reproduce
No response
What is your development environment
PlatformIO, but the example above was also tested to have the issue with arduino IDE
I have checked existing issues, discussions and online documentation
The text was updated successfully, but these errors were encountered: