fix(pai-voice-system): Add Linux platform support for audio playback#356
Closed
pkumaschow wants to merge 2 commits into
Closed
fix(pai-voice-system): Add Linux platform support for audio playback#356pkumaschow wants to merge 2 commits into
pkumaschow wants to merge 2 commits into
Conversation
- Detect platform (macOS vs Linux) using os.platform() - Update playAudio() to use ffplay on Linux instead of afplay - Update sendNotification() to conditionally use osascript on macOS only - Add notify-send support on Linux (optional, graceful degradation) - Maintain full macOS compatibility Tested on Linux (Fedora) with ffplay successfully playing ElevenLabs TTS output. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
… issue
Short audio messages were being cut off on Linux due to audio system
fade-in delay. This fix adds 0.5 seconds of silence padding before
playback to give the audio system time to wake up.
Changes:
- Add 0.5s silence padding using ffmpeg for Linux platform
- Enhanced error logging for debugging audio issues
- Proper cleanup of both original and padded temp files
- Graceful fallback to non-padded playback if ffmpeg fails
- macOS behavior unchanged (no padding needed)
Technical details:
- Uses ffmpeg's anullsrc filter to generate silence
- Concatenates silence + audio before playback
- Maintains ffplay for actual playback (volume control)
Tested on Linux (Fedora) with both short ("Done") and long messages.
Short messages now play completely without being cut off.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
|
Already addressed in #351 |
Collaborator
|
Thank you for the Linux audio playback support, @pkumaschow! Cross-platform audio is important for the voice system. Unfortunately, v3.0 restructured the codebase and the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tested on Linux (Fedora) with ffplay successfully playing ElevenLabs TTS output.