We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
conditions:
python3 -m http.server
results: lots of jittering.
actions tried:
here is my code:
#include <Arduino.h> #include <WiFi.h> #include "AudioFileSourceICYStream.h" #include "AudioFileSourceBuffer.h" #include "AudioGeneratorMP3.h" #include <AudioOutputI2S.h> #include "pins.h" #ifndef STASSID #define STASSID "wifi_wpa2" #define STAPSK "<password>" #endif const char* ssid = STASSID; const char* password = STAPSK; AudioGeneratorMP3 *mp3; AudioFileSourceHTTPStream *file; AudioFileSourceBuffer *buff; AudioOutputI2S *out; // Called when there's a warning or error (like a buffer underflow or decode hiccup) void StatusCallback(void *cbData, int code, const char *string) { const char *ptr = reinterpret_cast<const char *>(cbData); // Note that the string may be in PROGMEM, so copy it to RAM for printf char s1[64]; strncpy_P(s1, string, sizeof(s1)); s1[sizeof(s1)-1]=0; Serial.printf("STATUS(%s) '%d' = '%s'\n", ptr, code, s1); Serial.flush(); } void setup() { Serial.begin(115200); delay(1000); Serial.println("Connecting to WiFi"); WiFi.disconnect(); WiFi.softAPdisconnect(true); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { Serial.println("...Connecting to WiFi"); delay(1000); } Serial.println("Connected"); Serial.println((int)getCpuFrequencyMhz()); audioLogger = &Serial; file = new AudioFileSourceHTTPStream("http://localip/file.mp3"); file->useHTTP10(); buff = new AudioFileSourceBuffer(file, 8192); buff->RegisterStatusCB(StatusCallback, (void*)"buffer"); out = new AudioOutputI2S(0, 0, 32); out->SetChannels(1); out->SetOutputModeMono(true); out->SetPinout(BCK, WS, DOUT); mp3 = new AudioGeneratorMP3(); mp3->RegisterStatusCB(StatusCallback, (void*)"mp3"); mp3->begin(buff, out); } void loop() { static int lastms = 0; if (mp3->isRunning()) { if (millis()-lastms > 1000) { lastms = millis(); Serial.printf("Running for %d ms...\n", lastms); Serial.flush(); } if (!mp3->loop()) mp3->stop(); } else { Serial.printf("MP3 done\n"); delay(1000); } }
The text was updated successfully, but these errors were encountered:
Looks like the file is the reason but I don't know why:
ok.mp3: MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo bad.mp3: Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v1, 64 kbps, 44.1 kHz, Stereo
Sorry, something went wrong.
No branches or pull requests
conditions:
python3 -m http.server
results: lots of jittering.
actions tried:
but no change
here is my code:
The text was updated successfully, but these errors were encountered: