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

ffmpeg needs to be installed #3

Closed
stuartmaxwell opened this issue Nov 7, 2023 · 1 comment
Closed

ffmpeg needs to be installed #3

stuartmaxwell opened this issue Nov 7, 2023 · 1 comment

Comments

@stuartmaxwell
Copy link

Hi Simon - I believe this needs to have ffmpeg installed before this will work.

Before installing ffmpeg:

$ ospeak "Hello there"
/Users/stuart/.local/pipx/venvs/ospeak/lib/python3.11/site-packages/pydub/utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
  warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
/Users/stuart/.local/pipx/venvs/ospeak/lib/python3.11/site-packages/pydub/utils.py:198: RuntimeWarning: Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work
  warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning)
Traceback (most recent call last):
  File "/Users/stuart/.local/bin/ospeak", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/Users/stuart/.local/pipx/venvs/ospeak/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stuart/.local/pipx/venvs/ospeak/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/stuart/.local/pipx/venvs/ospeak/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stuart/.local/pipx/venvs/ospeak/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stuart/.local/pipx/venvs/ospeak/lib/python3.11/site-packages/ospeak/cli.py", line 84, in cli
    stream_and_play(text, voice, speed, speak or not output, token, output)
  File "/Users/stuart/.local/pipx/venvs/ospeak/lib/python3.11/site-packages/ospeak/cli.py", line 23, in stream_and_play
    audio = AudioSegment.from_file(byte_stream, format="mp3")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stuart/.local/pipx/venvs/ospeak/lib/python3.11/site-packages/pydub/audio_segment.py", line 728, in from_file
    info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stuart/.local/pipx/venvs/ospeak/lib/python3.11/site-packages/pydub/utils.py", line 274, in mediainfo_json
    res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stuart/.pyenv/versions/3.11.6/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Users/stuart/.pyenv/versions/3.11.6/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe'

Then I installed ffmpeg: brew install ffmpeg

And the command worked perfectly. Probably just needs a note in the README file.

Thanks!

@simonw
Copy link
Owner

simonw commented Nov 7, 2023

That's annoying - I got the impression from somewhere that adding simpleaudio as a dependency might mean ffmpeg wasn't necessary, but apparently not.

I'll update the README - thanks!

@simonw simonw closed this as completed in 7171416 Nov 7, 2023
simonw added a commit that referenced this issue Dec 13, 2023
Refs #3, #4, #5, #7, #8, #10, #12
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