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

add support for speechify service #109

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sourabhsinha396
Copy link

@sourabhsinha396 sourabhsinha396 commented Mar 6, 2025

Add Speechify TTS Service Support

This PR adds support for Speechify's text-to-speech API as a new service in manim-voiceover.

Features

  • Implements a new SpeechifyService class that interfaces with the Speechify API
  • Includes token-based authentication with automatic refresh when tokens expire
  • Properly handles caching to avoid unnecessary API calls
  • Supports all standard manim-voiceover functionality including global speed adjustment

Good things

  • Uses token-based authentication for better security (obtains access tokens using the API key)
  • Implements okayish error handling and logging
  • Gracefully recovers from 401 unauthorized errors by automatically refreshing the token

Usage Example

from manim_voiceover.services.speechify import SpeechifyService

# Initialize the service with your Speechify voice ID
speechify = SpeechifyService(
    voice_id="your_voice_id_here",
    model="simba-english",  # optional
    api_key="your_api_key_here"  # or set via SPEECHIFY_API_KEY environment variable
)

# Use it in your scene
class MyScene(VoiceoverScene):
    def construct(self):
        self.init_voiceover(speechify)
        with self.voiceover("Hello, this is a test using Speechify."):
            self.play(...)

@sourabhsinha396 sourabhsinha396 requested a review from osolmaz as a code owner March 6, 2025 07:36
@sourabhsinha396
Copy link
Author

ModernQuizWithVoiceover.mp4

Sample output, I could get this from speechify.

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