Skip to content
Advertisement

Opening wav from URL in Python

With the Python script shown below I try to play a wav file from the internet but I’m getting the error message OSError: [Errno 22] Invalid argument: 'https://file-examples-com.github.io/uploads/2017/11/file_example_WAV_1MG.wav'.

How can I play a wav file from the internet?

JavaScript

Advertisement

Answer

You can also get the content of website, store it in a variable, and play it. There is no need to store it on the disk for a short file like this. Here is an example of how to do this:

JavaScript
Advertisement