I want to create 32bit float WAV files in Python (2.x). While \"standard\" WAV files usually use int, many professional audio applications process (and save) audio data as float
I tried testing P Moran's code and absolutely does not work, like 'len(int(3))?'. Sorry man, I don't think it was tested. But fear not, modern python has ways!
import numpy as np
songtime=np.arange(0,100,60/44100.,dtype=float)
coswav=np.cos(songtime)
sinewav=np.sin(songtime)
np.column_stack((coswav,sinwav))
songwav=np.column_stack((coswav,sinwav)).astype('float32')
import scipy.io.wavfile as scipy_io_wavfile
scipy_io_wavfile.write("5secof60Hz.wav",44100,songwav)
https://docs.python.org/3.7/library/wave.html https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.wavfile.write.html