4 ms·
How do I save the audio array to a file on the file system?
by computerex 3y ago
How do I save the audio array to a file on the file system?
- CamperBob2 3y agoThere appear to be several ways to do it, but what worked for me was: from scipy.io.wavfile import write as write_wav write_wav("c:\\wherever\\whatever.wav", SAMPLE_RATE, audio_array) If you want to play it right away, you can use: from playsound import playsound playsound("c:\\wherever\\whatever.wav") What I wasn't able to do was make torchaudio play it directly, without creating an intermediate .wav file. Apparently there is a live-playback backend on the Mac, but not on on any other OS.