self.f.setsampwidth(sampwidth)
self.f.setframerate(framerate)
self.f.setnframes(nframes)
output = '\x00' * nframes * nchannels * sampwidth
self.f.writeframes(output)
self.f.close()
How to write stereo wav files in Python?