0

I followed the top answer in this StackOverflow post to use ffmpeg-python extract a .wav file from a YouTube URL (into the pcm_s16le codec), which was played successfully by my local audio player (Mac's Music). However, as I tried to read it using scipy.io's wavefile,

samplerate, data = wavfile.read(wav_fname)

the following error message is thrown: "WavFileWarning: Reached EOF prematurely; finished at 1192015 bytes, expected 4294967303 bytes from header."

May anyone suggest what's going on?

I have successfully extracted a .wav file which is successfully read by my local music player. However, it is failed to be recognized by scipy.io's wavefile. And I am not sure why.

  • That might be [SciPy issue 10835](https://github.com/scipy/scipy/issues/10835), which was fixed by [pull request 10870](https://github.com/scipy/scipy/pull/10870). But that fix was back in SciPy version 1.4. Which version of SciPy are you using? If you don't know, you can check with `import scipy; print(scipy.__version__)` – Warren Weckesser Oct 27 '22 at 11:53

0 Answers0