Hello,
Hopefully this is the right forum for this... I'm using an Arduino Uno paired with SparkFun's MP3 player shield. The File.available() function in the SD library for Arduino 022 seems to be reporting spurious information, at least for me. Originally in my loop, I had it walk through reading files off the SD card in 32 byte chunks and using available() to track how many bytes remained in the file. But after much confusion and serial output debugging, I was able to nail down that available() was not reporting accurately. It would decrement properly with each read() but it never started in the right place! For one of my files it always reported it as only 7734 bytes long before the first read() (which is a tenth of my file's size) and for the second file it consistently reported a negative number.
File.size() works just fine for me. I rewrote my code to use that function and then track how many bytes I read out of the file within my sketch. So my program is running great now (and actually playing the whole file out through audio when it should). But I figured I should report this. could this something going wrong that's unique to my SD card? (I know those can be quirky sometimes.) Or is this an actual bug in Arduino's SD library?
Thanks