improved web ui, upload is sorta better, 5sec advertise btn
This commit is contained in:
+15
-3
@@ -25,9 +25,21 @@ Pairs with the firmware in `../baby_mobile_v2/baby_mobile_v2.ino`.
|
||||
| | UUID | Use |
|
||||
|---|---|---|
|
||||
| Service | `12340001-…` | advertised |
|
||||
| Cmd (write) | `12340002-…` | `0x02 <slot>` start upload · `0x03` finish · `0x04 <slot>` play · `0x05` stop · `0x06` list · `0x07 <slot>` delete |
|
||||
| Data (write-without-response) | `12340003-…` | raw WAV bytes, chunked to 180 B |
|
||||
| Status (notify) | `12340004-…` | tagged by byte 0: `0x00…` upload byte count (uint32 BE) · `0x80\|idx, bits, kHz, secs` list entry · `0xFF, n` list end · `0xD0, idx, ok` delete reply |
|
||||
| Cmd (write) | `12340002-…` | `0x02 <slot>` start upload · `0x03` finish · `0x04 <slot>` play · `0x05` stop · `0x06` list · `0x07 <slot>` delete · `0x08 <pct>` set volume (persisted) · `0x09` get volume |
|
||||
| Data (write-without-response) | `12340003-…` | raw WAV bytes, chunked to MTU−3 |
|
||||
| Status (notify) | `12340004-…` | tagged by byte 0: `0x00…` upload byte count (uint32 BE) · `0x80\|idx, bits, kHz, secs` list entry · `0xC0, pct` volume reply · `0xD0, idx, ok` delete reply · `0xFF, n` list end |
|
||||
|
||||
### Volume
|
||||
|
||||
- **Global volume** is a master gain on the device (Q8 fixed-point, applied to all
|
||||
playback). It's persisted to LittleFS (`/volume`) so it survives reboots. The
|
||||
app reads it on connect (`0x09`) and sets it via the Playback-volume slider
|
||||
(`0x08`). Lowering it reduces the PWM swing → less amp output → less supply
|
||||
current, which mitigates the regulator brown-out at high volume.
|
||||
- **Per-file level** is baked into the WAV in the browser *before upload* (the
|
||||
"This file's level" slider scales the samples). Effective loudness =
|
||||
global × per-file. Note: attenuating an 8-bit clip costs dynamic range, so use
|
||||
16-bit if you plan to run a file much quieter than the rest.
|
||||
|
||||
## Running it
|
||||
|
||||
|
||||
Reference in New Issue
Block a user