Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎧 fix(TTS): Improve State of audio playback, hook patterns, and fix undefined MediaSource #3632

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

danny-avila
Copy link
Owner

Summary

  • Improved state management in the useTextToSpeech hook by separating out isSpeaking state and integrating it with the audio reference.
  • Implemented improved error handling and logging in StreamAudio.tsx and MessageAudio.tsx for better debugging.
  • Added checks for MediaSource definition to prevent runtime errors.
  • Streamlined the code for TTS hook patterns across useTextToSpeechBrowser, useTextToSpeechEdge, and useTextToSpeechExternal by using consistent interfaces.
  • Enhanced conditional logic for setting up and canceling speech generation based on the selected endpoint.

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Testing

I manually tested the audio playback across different browsers to ensure compatibility and verified the logging outputs for accuracy. Additionally, I recommend setting up automated tests to check for any regressions in the audio playback workflow.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes

@danny-avila danny-avila merged commit dc8d30a into main Aug 13, 2024
3 checks passed
@danny-avila danny-avila deleted the fix/tts branch August 13, 2024 16:08
danny-avila added a commit that referenced this pull request Aug 17, 2024
kenshinsamue pushed a commit to intelequia/LibreChat that referenced this pull request Sep 17, 2024
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.

1 participant