PWM Audio with reading data from SD card

Aiai... Off course! That are indeed two terrible mistakes. I'm actually very sorry to even ask the question...

That helps a lot, thanks!!

I changed it and it plays some sounds now. Not completely correct yet. I think that the reading of the text file, storing in an array and then converting into an integer takes too much time in the ISR. I changed it to reading a value from the wav-file direct, and that sounds closer to the original sound already, but not fully satisfying. A little bit more work needed I guess.

Is there perhaps another way of buffering a audio stream like this from an SD card, which someone has experience with already?

Our goal is to have a library of 24 sounds where the sketch picks one, according to the input read from the infrared receiver. I noticed that storing 500 char's in an array is around the maximum we can go on the flash memory of the Nanode, so I think we do have to use the external memory on the SD card. For as we want to have 100 fully independent units in the field, we're looking to use as much hardware solutions as possible.

Thank you for any suggestions!