Skip to content

Cross-platform-audio - #48

Merged
CoffeeMethod merged 3 commits into
mainfrom
Cross-platform-audio
Aug 22, 2026
Merged

Cross-platform-audio#48
CoffeeMethod merged 3 commits into
mainfrom
Cross-platform-audio

Conversation

@CoffeeMethod

Copy link
Copy Markdown
Owner

No description provided.

kokoro_engine.py and gui.py unconditionally imported the Windows-only
winsound module for preview/JIT playback, forcing the whole app (and
CI) onto windows-latest. Add playback.py, a small sounddevice +
soundfile wrapper (play/stop), and swap it in at all four call sites:

- kokoro_engine.py: cancel()'s SND_PURGE -> playback.stop(), and the
  JIT playback loop's blocking PlaySound -> playback.play(path, True)
- gui.py: the two fire-and-forget preview buttons -> playback.play(path)

playback.py degrades to a no-op if sounddevice can't find the system
PortAudio library, so machines without libportaudio2 installed don't
crash on import.

Also:
- Add sounddevice to requirements.txt
- Repoint conftest.py's engine/real_engine fixtures to mock
  kokoro_engine.playback instead of kokoro_engine.winsound
- Add ubuntu-latest to the CI matrix (installs libportaudio2 for
  sounddevice, xvfb for the Tk-based GUI tests, runs under xvfb-run)
- Update README's testing/CI notes, which had drifted out of date
@CoffeeMethod CoffeeMethod linked an issue Aug 22, 2026 that may be closed by this pull request
@CoffeeMethod
CoffeeMethod merged commit 18fee09 into main Aug 22, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Making this work on Ubuntu

1 participant