Ignore Unicode errors in input file metadata

This commit is contained in:
Guillaume Klein
2023-03-21 17:13:37 +01:00
parent 0ab8db2b37
commit c27c010f96

View File

@@ -34,7 +34,7 @@ def decode_audio(input_file: Union[str, BinaryIO], sampling_rate: int = 16000):
raw_buffer = io.BytesIO()
dtype = None
with av.open(input_file) as container:
with av.open(input_file, metadata_errors="ignore") as container:
frames = container.decode(audio=0)
frames = _group_frames(frames, 500000)
frames = _resample_frames(frames, resampler)