python-soundfile
python-soundfile copied to clipboard
Error while trying to read with url
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?
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)?