incidentist / the_tuul

Make a decent karaoke video from any song in about 10 minutes.
https://the-tuul.com
17 stars 4 forks source link

FLAC file failure in librosa #25

Open incidentist opened 10 months ago

incidentist commented 10 months ago

Someone generated a video from a FLAC file that caused this error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/app/views.py", line 40, in post
    success = make_karaoke_video.run(
  File "/app/karaoke/make_karaoke_video.py", line 43, in run
    instrumental_path, vocals_path = music_separation.split_song(
  File "/app/karaoke/music_separation.py", line 27, in split_song
    accompaniment_filename, vocals_filename = separator.separate()
  File "/usr/local/lib/python3.9/site-packages/audio_separator/separator.py", line 197, in separate
    mix, raw_mix, samplerate = prepare_mix(self.audio_file_path, self.chunks, self.margin, mdx_net_cut=mdx_net_cut)
  File "/usr/local/lib/python3.9/site-packages/audio_separator/separator.py", line 338, in prepare_mix
    mix, samplerate = librosa.load(mix, mono=False, sr=44100)
  File "/usr/local/lib/python3.9/site-packages/librosa/util/decorators.py", line 88, in inner_f
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/librosa/core/audio.py", line 164, in load
    y, sr_native = __soundfile_load(path, offset, duration, dtype)
  File "/usr/local/lib/python3.9/site-packages/librosa/core/audio.py", line 208, in __soundfile_load
    y = sf_desc.read(frames=frame_duration, dtype=dtype, always_2d=False).T
  File "/usr/local/lib/python3.9/site-packages/soundfile.py", line 888, in read
    out = self._create_empty_array(frames, always_2d, dtype)
  File "/usr/local/lib/python3.9/site-packages/soundfile.py", line 1320, in _create_empty_array
    return np.empty(shape, dtype, order='C')
ValueError: array is too big; `arr.size * arr.dtype.itemsize` is larger than the maximum possible size.
incidentist commented 10 months ago

Possibly related: https://github.com/bastibe/python-soundfile/issues/361