Skip to content
Advertisement

Tag: wave

How to get wave module methods for reading a .wav audio but with a temporary file tempfile.SpooledTemporaryFile obtained from fastAPI post request?

I have a function that receives a .wav audio path directory and return its pcm_data in bytes, sample_rate as int and duration as float. Now I want that the audio file comes from a uploaded audio using POST request with FastAPI, so if I upload a .wav audio using the UploadFile class from fastapi, I get a tempfile.SpooledTemporaryFile, how can

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? Answer You can also get the content of website, store it in a variable, and play it. There is no need to

Advertisement