decode_audio fails on audio files whose stream changes sample rate (or sample format) partway through. _group_frames creates an AudioFifo() and writes every decoded frame into it, but the FIFO locks onto the parameters of the first frame and rejects any later frame that differs:
File "faster_whisper/audio.py", line 96, in _group_frames
fifo.write(frame)
File "av/audio/fifo.pyx", line 81, in av.audio.fifo.AudioFifo.write
ValueError: Frame does not match AudioFifo parameters.
The AudioResampler later in the chain would happily normalize these frames, but the crash happens in _group_frames, before resampling.
Sample audio that produces the issue.
whisper-french-mixed-samplerate.mp3
This issue has been reported in my project by user. The sample file above is a synthetic/crafted example, but apparently such issue can happen in the wild.
Love faster whisper, excellent tool!
Best regards and much energy in future development of faster whisper!
decode_audiofails on audio files whose stream changes sample rate (or sample format) partway through._group_framescreates anAudioFifo()and writes every decoded frame into it, but the FIFO locks onto the parameters of the first frame and rejects any later frame that differs:The AudioResampler later in the chain would happily normalize these frames, but the crash happens in _group_frames, before resampling.
Sample audio that produces the issue.
whisper-french-mixed-samplerate.mp3
This issue has been reported in my project by user. The sample file above is a synthetic/crafted example, but apparently such issue can happen in the wild.
Love faster whisper, excellent tool!
Best regards and much energy in future development of faster whisper!