Review fixes: correct Piper TTS API + bot env gating
Some checks failed
Release / semantic-release (push) Successful in 21s
tests / Unit tests (Linux, Python 3.11) (push) Successful in 9m53s
Release / build-linux (push) Failing after 7m12s
Release / build-windows (push) Has been cancelled
Release / build-macos (arm64, macos-latest) (push) Has been cancelled
Release / build-macos (x64, macos-15-intel) (push) Has been cancelled
Release / release-main (push) Has been cancelled
Release / release-develop (push) Has been cancelled
Some checks failed
Release / semantic-release (push) Successful in 21s
tests / Unit tests (Linux, Python 3.11) (push) Successful in 9m53s
Release / build-linux (push) Failing after 7m12s
Release / build-windows (push) Has been cancelled
Release / build-macos (arm64, macos-latest) (push) Has been cancelled
Release / build-macos (x64, macos-15-intel) (push) Has been cancelled
Release / release-main (push) Has been cancelled
Release / release-develop (push) Has been cancelled
Code review of the bridge/bot/docker work found: - TTS bug: bridge called PiperVoice.synthesize(text, wav) but that method returns AudioChunks and takes a SynthesisConfig as its 2nd arg, not a wav file -> TTS would fail. Switched to synthesize_wav(text, wav_file). Verified: produces a valid 22050Hz mono WAV. - run-bot.sh now waits if ANY of DISCORD_BOT_TOKEN/APP_ID/GUILD_ID is missing (config.ts throws on a missing one), preventing a supervisor crash-loop. Verified clean: discord.js Events.ClientReady == 'clientReady' (existing handler correct); image rebuilds.
This commit is contained in:
@@ -197,7 +197,10 @@ def synthesize(text: str) -> Optional[bytes]:
|
||||
return None
|
||||
buf = io.BytesIO()
|
||||
with wave.open(buf, "wb") as wf:
|
||||
_piper_voice.synthesize(text, wf)
|
||||
# piper-tts API: synthesize_wav(text, wav_file) writes a full WAV;
|
||||
# plain synthesize() returns AudioChunks and takes a SynthesisConfig
|
||||
# (NOT a wav file) as its 2nd arg.
|
||||
_piper_voice.synthesize_wav(text, wf)
|
||||
return buf.getvalue()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user