zh-plus / openlrc

Transcribe and translate voice into LRC file using Whisper and LLMs (GPT, Claude, et,al). 使用whisper和LLM(GPT,Claude等)来转录、翻译你的音频为字幕文件。
https://zh-plus.github.io/openlrc/
MIT License
449 stars 32 forks source link

exception when running #7

Closed ClaireCJS closed 1 year ago

ClaireCJS commented 1 year ago

Alas, this did not work for me.

[why are we probing an mp3 anyway?]

 [2023-07-06 07:52:54] WARNING  [MainThread] The torchaudio backend is switched to 'soundfile'. Note that 'sox_io' is not supported on Windows.
 [2023-07-06 07:52:54] WARNING  [MainThread] The torchaudio backend is switched to 'soundfile'. Note that 'sox_io' is not supported on Windows.
Traceback (most recent call last):
  File "C:\ProgramData\anaconda3\lib\site-packages\openlrc\utils.py", line 52, in get_file_type
    video_stream = ffmpeg.probe(path, select_streams='v')['streams']
  File "C:\ProgramData\anaconda3\lib\site-packages\ffmpeg\_probe.py", line 23, in probe
    raise Error('ffprobe', out, err)
ffmpeg._run.Error: ffprobe error (see stderr output for detail)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\BAT\lrc.py", line 7, in <module>
    lrcer.run(sys.argv[0])  # Generate translated test.lrc with default translate prompt.
  File "C:\ProgramData\anaconda3\lib\site-packages\openlrc\openlrc.py", line 168, in run
    audio_paths = self.pre_process(paths)
  File "C:\ProgramData\anaconda3\lib\site-packages\openlrc\openlrc.py", line 232, in pre_process
    paths[i] = extract_audio(path)
  File "C:\ProgramData\anaconda3\lib\site-packages\openlrc\utils.py", line 25, in extract_audio
    file_type = get_file_type(path)
  File "C:\ProgramData\anaconda3\lib\site-packages\openlrc\utils.py", line 54, in get_file_type
    raise FfmpegException(f'ffmpeg error: {e}')
openlrc.exceptions.FfmpegException: ffmpeg error: ffprobe error (see stderr output for detail)
zh-plus commented 1 year ago

I have recently made changes to the implementation of get_file_type in a commit. Instead of using ffmpeg, I am now utilizing another library to check the file type. Please try installing the latest version directly from Github:

pip install git+https://github.com/zh-plus/Open-Lyrics

Users don't need to install ffmpeg unless they want to include videos in the input path.

ClaireCJS commented 1 year ago

Something is broken with using pip and git that way, I had to manually clone it and copy the files over haha.

BUT IT WORKED!

Thank you!

I was this close to writing my own, but this one is way better. You've put some real nice work into it!! The karaoke LRC i'm viewing is pretty perfect!

Only thing I would change would be to have shorter lines in some places.