feat: smooth volume ramping over 200ms in audio streaming
Some checks failed
CI / test (3.11) (push) Failing after 22s
CI / test (3.12) (push) Failing after 22s
CI / test (3.13) (push) Failing after 22s

Volume changes now ramp linearly per-sample via _scale_pcm_ramp instead
of jumping abruptly. Each frame steps _cur_vol toward target by at most
0.1, giving ~200ms for a full 0-to-1 sweep. Fast path unchanged when
volume is stable.
This commit is contained in:
user
2026-02-21 23:32:22 +01:00
parent c5c61e63cc
commit 6b7d733650
4 changed files with 115 additions and 9 deletions

View File

@@ -1565,7 +1565,7 @@ and voice transmission.
- `libopus` -- Opus codec (used by pymumble/opuslib)
```
!play <url> Play audio or add to queue
!play <url|playlist> Play audio or add to queue (playlists expanded)
!stop Stop playback, clear queue
!skip Skip current track
!queue Show queue
@@ -1576,8 +1576,11 @@ and voice transmission.
```
- Queue holds up to 50 tracks
- Volume takes effect immediately during playback (default: 50%)
- Title resolved via `yt-dlp --get-title` before playback
- Playlists are expanded into individual tracks; excess tracks are
truncated at the queue limit
- Volume changes ramp smoothly over ~200ms (no abrupt jumps)
- Default volume: 50%
- Titles resolved via `yt-dlp --flat-playlist` before playback
- Audio pipeline: `yt-dlp | ffmpeg` subprocess, PCM fed to pymumble
- Commands are Mumble-only; `!play` on other adapters replies with an error,
other music commands silently no-op