bool AudioPlaySdRaw::play(const char *filename) | bool AudioPlaySdRaw::play(const char *filename) | ||||
{ | { | ||||
stop(); | stop(); | ||||
__disable_irq(); | |||||
rawfile = SD.open(filename); | rawfile = SD.open(filename); | ||||
__enable_irq(); | |||||
if (!rawfile) { | if (!rawfile) { | ||||
//Serial.println("unable to open file"); | //Serial.println("unable to open file"); | ||||
return false; | return false; |
bool AudioPlaySdWav::play(const char *filename) | bool AudioPlaySdWav::play(const char *filename) | ||||
{ | { | ||||
stop(); | stop(); | ||||
// TODO: SD.open probably needs to be done with the audio interrupt disabled... | |||||
__disable_irq(); | |||||
wavfile = SD.open(filename); | wavfile = SD.open(filename); | ||||
__enable_irq(); | |||||
if (!wavfile) return false; | if (!wavfile) return false; | ||||
buffer_length = 0; | buffer_length = 0; | ||||
buffer_offset = 0; | buffer_offset = 0; |