bool AudioLoadSdRaw::play() { stop(); AudioStartUsingSPI(); if (!rawfile) { //Serial.println("No file loaded!\n"); return false; } //Serial.println("able to open file"); playing = true; return true; }
bool AudioPlaySdWav::play(const char *filename) { stop(); AudioStartUsingSPI(); __disable_irq(); wavfile = SD.open(filename); __enable_irq(); if (!wavfile) return false; buffer_length = 0; buffer_offset = 0; state_play = STATE_STOP; data_length = 20; header_offset = 0; state = STATE_PARSE1; return true; }
bool AudioPlaySerialflashRaw::play(const char *filename) { stop(); AudioStartUsingSPI(); rawfile = SerialFlash.open(filename); if (!rawfile) { //Serial.println("unable to open file"); AudioStopUsingSPI(); return false; } file_size = rawfile.size(); file_offset = 0; //Serial.println("able to open file"); playing = true; return true; }
bool AudioPlaySerialflashRaw::play(const char *filename) { stop(); AudioStartUsingSPI(); rawfile = SerialFlash.open(filename); if (!rawfile) { //Serial.println("unable to open file"); AudioStopUsingSPI(); return false; } file_size = rawfile.size(); file_offset = 0; //Serial.println("able to open file"); if(!strcmp(filename + strlen(filename) - 3, "ULW")) playing = 0x01; //ulaw else playing = 0x81; //PCM 16 bit return true; }
bool AudioPlaySdRaw::playFrom(const char *filename, unsigned long startPoint) { stop(); AudioStartUsingSPI(); __disable_irq(); rawfile = SD.open(filename); __enable_irq(); if (!rawfile) { //Serial.println("unable to open file"); return false; } file_size = rawfile.size(); rawfile.seek(startPoint % file_size); file_offset = startPoint; //Serial.println("able to open file"); playing = true; return true; }