You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 583225f
Browse filesBrowse the repository at this point in the historyBrowse files
feat: fade in audiobook resume to mask the cold-start glitch
Continuing an audiobook from a saved position stutters for the first
~2 s: opening the file, decoding the first MP3 frames and seeking to the
resume position saturate the 1-bit SD/CPU while I2S is already playing,
so the input buffer underruns until it catches up.
Hide it elegantly instead of fighting the hardware: on resume, rewind a
few seconds before the saved position and start muted, then ramp the
audio-lib volume back up over the fade duration. The glitch now lands on
already-heard audio, so no content is lost and playback sounds clean from
where you stopped. Only the audio-lib gain is ramped; the UI/MQTT volume
is untouched, and a manual volume change cancels an active fade.
Tunable via RESUME_FADEIN_DURATION_MS / RESUME_FADEIN_REWIND_S in
settings.h (duration 0 disables the feature).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -206,6 +206,7 @@ neon logo that doubles as the SVG favicon ([`7be5254`](../../commit/7be5254)):
206
206
| Unlocking controls via button press while locked |[`d83e15f`](../../commit/d83e15f)|
207
207
| Support for a 6th button |[`b116151`](../../commit/b116151)|
208
208
| OLED display support (SH1106/SSD1306 128×64 over I2C): boot splash, idle screen with IP + READY, now-playing title (up to 3 lines, scrolling) with battery/time/wifi status bar, and a volume bar |[`8ce8104`](../../commit/8ce8104)|
209
+
| Audiobook resume fade-in: continuing a saved position briefly stutters in the first ~2 s (file open + MP3 header decode + seek-flush saturate the 1-bit SD/CPU while I2S already plays). The resume now rewinds a few seconds and fades the volume up over that span, so the glitch lands on already-heard audio — no content lost, clean sound from where you stopped. Tunable / disable via `RESUME_FADEIN_DURATION_MS` and `RESUME_FADEIN_REWIND_S` in `settings.h`|[`PENDINGHASH`](../../commit/PENDINGHASH)|
Copy file name to clipboardExpand all lines: src/settings.h
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,15 @@
59
59
//#define HALLEFFECT_SENSOR_ENABLE // Support for hallsensor. For fine-tuning please adjust HallEffectSensor.h Please note: only user-support provided (https://forum.espuino.de/t/magnetische-hockey-tags/1449/35)
60
60
//#define RTC_ENABLE // Battery-backed real-time-clock (DS3231) on i2cBusTwo. Keeps the time correct without WiFi/NTP. RTC stores UTC; timezone is applied on top.
// When continuing an audiobook from a saved position, opening the file + decoding the
64
+
// first MP3 frames + seeking briefly saturates SD/CPU, so the first ~2 s can stutter.
65
+
// To hide it elegantly: rewind a few seconds before the saved position and fade the
66
+
// volume in over that span. The glitch then lands on already-heard audio -> no content
67
+
// is lost, and you hear clean sound from where you stopped. Set duration to 0 to disable.
68
+
#defineRESUME_FADEIN_DURATION_MS2500u// fade-in length in ms (0 = feature off)
69
+
#defineRESUME_FADEIN_REWIND_S3u// seconds to rewind before the saved resume-position
70
+
62
71
//################## set PAUSE_WHEN_RFID_REMOVED behaviour #############################
63
72
#ifdef PAUSE_WHEN_RFID_REMOVED
64
73
#defineACCEPT_SAME_RFID_AFTER_TRACK_END// Accepts same RFID after playback has ended (https://forum.espuino.de/t/neues-feature-pausieren-wenn-rfid-karte-entfernt-wurde/541/2)
0 commit comments