someone made a script who is supposed to record a wave file and send it at an email address.
I want instead of send it at an email address, save the file.
Here is the code :
import sounddevice as sd
import wave
fs = 44100
seconds = 60
obj = wave.open('sound.wav', 'w')
obj.setnchannels(1)
obj.setsampwidth(2)
obj.setframerate(fs)
myrecording = sd.rec(int(seconds * fs), samplerate=fs, channels=2)
obj.writeframesraw(myrecording)
sd.wait()
After launching the script, I have an empty wave file.
Is there something to save the file or something like that obj.save(r'XX')
?