python-soundfile icon indicating copy to clipboard operation
python-soundfile copied to clipboard

Error while trying to read with url

Open kyungyunlee opened this issue 6 years ago • 1 comments

I tried this example with HTTP request from the doc.

import io
import soundfile as sf
from urllib.request import urlopen

url = "http://tinyurl.com/shepard-risset"
data, samplerate = sf.read(io.BytesIO(urlopen(url).read()))

I am getting an error that says :

RuntimeError: Error opening <_io.BytesIO object at 0x1c18f17f68>: File contains data in an unimplemented format.

Is this example outdated?

kyungyunlee avatar Aug 25 '18 08:08 kyungyunlee

The example works for me. The link is pointing to an OGG file (http://upload.wikimedia.org/wikipedia/commons/6/61/DescenteInfinie.ogg), so I suspect that your version of libsndfile doesn't support that format.

Does it work if you download the file and open it directly from disk?

Which OS are you using? How did you install the soundfile module? How did you install the libsindfile library (if you did it manually)?

mgeier avatar Aug 28 '18 14:08 mgeier