collabora / WhisperLive

A nearly-live implementation of OpenAI's Whisper.
MIT License
1.99k stars 272 forks source link

Problem about Windows running client #252

Closed KujoStar closed 3 months ago

KujoStar commented 3 months ago

I run the server through docker and deployed it on a server. I run client on my PC like this:

from whisper_live.client import TranscriptionClient
client = TranscriptionClient(
  "172.18.64.66",
  9090,
  lang="zh",
  translate=False,
  model="small",
  use_vad=False,
)

client("./output_recording.wav")

It returns Error:

[INFO]: * recording
[INFO]: Opened connection
[INFO]: Server Running with backend faster_whisper
[INFO]: Waiting for server ready ...
[INFO]: Server Ready!
Traceback (most recent call last):
  File "D:\Project\python\WhisperLive\test.py", line 11, in <module>
    client("./output_recording.wav")
  File "D:\miniconda\envs\zhipu\lib\site-packages\whisper_live\client.py", line 329, in __call__
    resampled_file = utils.resample(audio)
  File "D:\miniconda\envs\zhipu\lib\site-packages\whisper_live\utils.py", line 61, in resample
    ffmpeg.input(file, threads=0)
  File "D:\miniconda\envs\zhipu\lib\site-packages\ffmpeg\_run.py", line 313, in run
    process = run_async(
  File "D:\miniconda\envs\zhipu\lib\site-packages\ffmpeg\_run.py", line 284, in run_async
    return subprocess.Popen(
  File "D:\miniconda\envs\zhipu\lib\subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "D:\miniconda\envs\zhipu\lib\subprocess.py", line 1436, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

the audio file "output_recording.wav" does exist in the same path. I run the client like this:

from whisper_live.client import TranscriptionClient
client = TranscriptionClient(
  "172.18.64.66",
  9090,
  lang="zh",
  translate=False,
  model="small",
  use_vad=False,
)

client()

It can run without problem, recording my voice and return the words. Why do I meet up with problem when processing an audio file?

KujoStar commented 3 months ago

This is done, I just install ffmpeg to fix this.