Fermain / -mollify

9 stars 9 forks source link

Add initial implementation of TTS fallback option #183

Open Ousman37 opened 9 months ago

Ousman37 commented 9 months ago

Added a browser-based TTS fallback option to ensure text-to-speech availability, especially when premium services are inaccessible.

Ousman37 commented 9 months ago

Thank you for your feedback! You bring up some important points. To ensure a seamless user experience, I'll make the following updates:

We'll add a check to see if there is an ElevenLabs API key available. If the key is available, we'll prioritize using ElevenLabs for audio generation. If the key is missing or the ElevenLabs generation fails, we'll then fall back to using browser-based TTS.

The feature will handle the decision-making process, making it more user-friendly and transparent.

I'll make these changes and update the PR accordingly. Thanks for your input!

Fermain commented 9 months ago

For example, in the Reader component:

  1. Attempt to request Elevenlabs Audio
  2. If this fails, set a fallback variable to true
  3. Use BrowserTTS to render the audio file instead
Ousman37 commented 9 months ago

Thanks for your feedback! I'll follow your advice:

  1. Implement client-side TTS with a fallback.
  2. Remove server-side TTS logic.
  3. Update documentation accordingly.

Your input is appreciated

Didi

Ousman37 commented 9 months ago

@Fermain I've implemented the suggestion for TTS Fallback Option in the BrowserTTS Component. Could you please review

Ousman37 commented 9 months ago

@Fermain and @pretzL Implement browser-based Text-to-Speech (TTS) functionality

This PR implements browser-based Text-to-Speech (TTS) functionality as requested. It introduces the following changes:

I hope this is the way you want it! These changes improve code organization and make it easier to maintain and extend the TTS functionality. The generateAudio function now provides the desired TTS features while allowing for fallback options when needed.

Please review and merge when ready. 🚀