fix: Resolve Mac Chrome TTS invocation, Qwen TTS missing parameters and UI layout issues (#12)#54
Open
0ostreamo0 wants to merge 3 commits intoTHU-MAIC:mainfrom
Open
Conversation
added 3 commits
March 17, 2026 17:04
…s issues Core changes: 1. lib/audio/tts-providers.ts: - Add default voice parameter 'Cherry' for Qwen TTS - Ensure language_type parameter is correctly passed 2. lib/utils/audio-player.ts: - Add BrowserTTSOptions interface definition - Implement playWithBrowserTTS method supporting native Web Speech API - Add async voices loading handling logic - Add setBrowserTTSEnabled method for enabling/disabling browser TTS fallback 3. lib/playback/engine.ts: - Integrate browser TTS support in playback engine - Dynamically prepare browserTTSOptions based on settings - Enable AudioPlayer's browser TTS fallback mechanism 4. components/audio/tts-config-popover.tsx: - Optimize TTS preview functionality with separate browser native TTS handling - Improve voice selection and error handling logic 5. Related files updated: - components/generation/media-popover.tsx: TTS testing optimization in media preview - components/settings/tts-settings.tsx: TTS testing improvements in settings page - components/stage.tsx: Audio playback adaptation in stage component - lib/action/engine.ts: TTS integration in action engine Issues resolved: - Mac Chrome browser TTS voice invocation failure - Classroom silence due to missing Qwen TTS service parameters - Async voices loading issues in browser native TTS - Provided complete browser TTS fallback mechanism for enhanced UX
- Added automated tests for Qwen TTS default voice parameter - Added tests for BrowserTTSOptions interface - Added tests for AudioPlayer browser TTS support - Added tests for PlaybackEngine integration - All 5 core tests passed successfully
- Wrapped GroupedSelect in flex container with flex-1 min-w-0 - Select now adapts to fill remaining space in the row - Preview button maintains fixed width - Fixes layout overflow issue in media popover
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.
Summary
This PR fixes critical TTS issues causing classroom silence on Mac Chrome browser and Qwen TTS service, along with UI layout improvements.
Problem Statement
speechSynthesis.getVoices()returning empty array due to async loading issueslanguage_typeparameter and default voice, causing silent failures in classroom playbackSolution
Core Changes
1. Qwen TTS Parameter Fix (
lib/audio/tts-providers.ts)'Cherry'for Qwen TTSlanguage_type: 'Chinese'parameter is correctly passed to API2. Browser Native TTS Support (
lib/utils/audio-player.ts)BrowserTTSOptionsinterface definitionplayWithBrowserTTS()method with Web Speech API supportsetBrowserTTSEnabled()method for enabling/disabling browser TTS fallback3. Playback Engine Integration (
lib/playback/engine.ts)browserTTSOptionspreparation based on user settings4. TTS Preview Optimization (
components/audio/tts-config-popover.tsx)5. UI Layout Fix (
components/generation/media-popover.tsx)flex-1 min-w-06. Related Files Updated
components/settings/tts-settings.tsx: Settings page TTS test improvementscomponents/stage.tsx: Stage component audio playback adaptationlib/action/engine.ts: Action engine TTS integrationTesting
Automated Tests ✅
Created comprehensive test suite (
tests/tts-fix.test.ts) verifying:language_type: 'Chinese'present in codeTest Results:
Run tests:
npx tsx tests/tts-fix.test.tsIssues Resolved
Checklist