使用命令时报错
Mars1993Earth opened this issue · comments
Describe the bug
Traceback (most recent call last):
File "/opt/homebrew/bin/wenet", line 8, in
sys.exit(main())
^^^^^^
File "/Users/mars/wenet/wenet/cli/transcribe.py", line 77, in main
result = model.transcribe(args.audio_file, args.show_tokens_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mars/wenet/wenet/cli/model.py", line 132, in transcribe
return self._decode(audio_file, tokens_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/mars/wenet/wenet/cli/model.py", line 81, in _decode
feats = self.compute_feats(audio_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mars/wenet/wenet/cli/model.py", line 61, in compute_feats
waveform, sample_rate = torchaudio.load(audio_file, normalize=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.12/site-packages/torchaudio/_backend/utils.py", line 205, in load
return backend.load(uri, frame_offset, num_frames, normalize, channels_first, format, buffer_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.12/site-packages/torchaudio/_backend/soundfile.py", line 27, in load
return soundfile_backend.load(uri, frame_offset, num_frames, normalize, channels_first, format)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.12/site-packages/torchaudio/backend/soundfile_backend.py", line 221, in load
with soundfile.SoundFile(filepath, "r") as file:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.12/site-packages/soundfile.py", line 658, in init
self._file = self._open(file, mode_int, closefd)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.12/site-packages/soundfile.py", line 1216, in _open
raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name))
soundfile.LibsndfileError: Error opening '20240520_133903.m4a': Format not recognised.
环境:
Python 3.12.3