sdResumePos

This commit is contained in:
e2002
2022-12-20 10:30:47 +03:00
parent 7750dfea5b
commit 2a2bbf2c16
3 changed files with 16 additions and 2 deletions

View File

@@ -2473,6 +2473,19 @@ uint32_t Audio::getAudioFileDuration(){
} }
uint32_t Audio::getAudioCurrentTime(){ uint32_t Audio::getAudioCurrentTime(){
return 0; //TODO return 0; //TODO
uint16_t MP3Status;
MP3Status = read_register(SCI_HDAT1);
//Serial.print("SCI_HDAT1\t"); Serial.println(MP3Status, BIN);
Serial.print("LAYER\t"); Serial.println(MP3Status>>1 & 0b11);
Serial.print("ID\t"); Serial.println(MP3Status>>3 & 0b11);
//HDAT0[15:12] bitrate https://cdn-shop.adafruit.com/datasheets/vs1053.pdf
MP3Status = read_register(SCI_HDAT0);
//Serial.print("SCI_HDAT0\t"); Serial.println(MP3Status, BIN);
Serial.print("BITRATE\t"); Serial.println(MP3Status>>12);
return 0; //TODO
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
uint32_t Audio::getAudioDataStartPos() { uint32_t Audio::getAudioDataStartPos() {

View File

@@ -1,7 +1,7 @@
#ifndef options_h #ifndef options_h
#define options_h #define options_h
#define YOVERSION "0.8.833" #define YOVERSION "0.8.834"
/******************************************************* /*******************************************************
DO NOT EDIT THIS FILE. DO NOT EDIT THIS FILE.
@@ -61,7 +61,7 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti
#define TFT_CS 255 #define TFT_CS 255
#endif #endif
#ifndef TFT_RST #ifndef TFT_RST
#define TFT_RST 15 // Or set to -1 and connect to Esp EN pin #define TFT_RST -1 // Or set to -1 and connect to Esp EN pin
#endif #endif
#ifndef TFT_DC #ifndef TFT_DC
#define TFT_DC 4 #define TFT_DC 4

View File

@@ -194,5 +194,6 @@ void audio_id3data(const char *info){ //id3 metadata
telnet.printf("##AUDIO.ID3#: %s\n", info); telnet.printf("##AUDIO.ID3#: %s\n", info);
} }
void audio_eof_mp3(const char *info){ //end of file void audio_eof_mp3(const char *info){ //end of file
config.sdResumePos = 0;
player.play(random(1, config.store.countStation)); player.play(random(1, config.store.countStation));
} }