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

Exception in thread Thread-13 (play): #247

Open
1Krosx1 opened this issue Jan 12, 2025 · 5 comments
Open

Exception in thread Thread-13 (play): #247

1Krosx1 opened this issue Jan 12, 2025 · 5 comments

Comments

@1Krosx1
Copy link

1Krosx1 commented Jan 12, 2025

Exception in thread Thread-13 (play):
Traceback (most recent call last):
File "C:\Users\User\anaconda\Lib\threading.py", line 1075, in _bootstrap_inner
self.run()
File "C:\Users\User\anaconda\Lib\threading.py", line 1012, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\User\Downloads\RealtimeTTS-0.4.40\RealtimeTTS-0.4.40\RealtimeTTS\text_to_stream.py", line 380, in play
self.player.start()
File "C:\Users\User\Downloads\RealtimeTTS-0.4.40\RealtimeTTS-0.4.40\RealtimeTTS\stream_player.py", line 552, in start
self.audio_stream.open_stream()
File "C:\Users\User\Downloads\RealtimeTTS-0.4.40\RealtimeTTS-0.4.40\RealtimeTTS\stream_player.py", line 184, in open_stream
raise ValueError(message)
ValueError: mpv not found, necessary to stream audio. On mac you can install it with 'brew install mpv'. On linux and windows you can install it from https://mpv.io/

@KoljaB
Copy link
Owner

KoljaB commented Jan 12, 2025

Please install MPV player to real-time playback MP3 chunks returned by ElevenlabsEngine and EdgeEngine.

@1Krosx1
Copy link
Author

1Krosx1 commented Jan 12, 2025

Hello @KoljaB
image
I am confuse what to download from the webpage you provided, I am trying to implement both TTS and STT can you pinpoint what mpv from the picture do i need to download?, btw thank you for this repository...highly appreciated....

@KoljaB
Copy link
Owner

KoljaB commented Jan 12, 2025

Probably easiest way to get MPV installed:

  1. Install Chocolatey
    Go to Chocolatey’s install page and follow the instructions.

  2. Install MPV
    Open PowerShell as admin and run this command:

    choco install mpv
  3. Check Your PATH
    Make sure MPV is in your PATH, so you can call it from the terminal.

  4. Test the Setup
    Run this in your terminal:

    mpv --version

    If everything’s good, you’ll see the MPV version along with details about the FFmpeg libraries.

@1Krosx1
Copy link
Author

1Krosx1 commented Jan 13, 2025

thanks @KoljaB but i am struggling where to put the elevenlabs api key i put it in the string but the error keeps on showing api is misssing, where is the api should put? thank you...

@KoljaB
Copy link
Owner

KoljaB commented Jan 13, 2025

You’ve got two options for passing the API key to the engine:

  1. Pass it directly as the api_key parameter:

    if __name__ == "__main__":
        from RealtimeTTS import TextToAudioStream, ElevenlabsEngine
        def dummy_generator():
            yield "This is a synthesis test."
    
        engine = ElevenlabsEngine(api_key="<YOUR_ELEVENLABS_API_KEY>")
        stream = TextToAudioStream(engine)
        stream.feed(dummy_generator()).play(log_synthesized_text=True)
  2. Set it as ELEVENLABS_API_KEY environment variable. This way, the key stays stored and you don’t have to hardcode it into your script every time.

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

No branches or pull requests

2 participants