I've been trying to do something that I thought would be fairly simple, and that si to save winsound.Beep(8000,1000) to a .wav file called LongBeep.wav . Can someone pls reply with a solution. I have searched and searched for an answer but have found nothing. Here is the code that I have:
import sounddevice as sd
import soundfile as sf
import winsound
import time
sr = 44100
duration = 5
myrecording = sd.rec(int(duration * sr), samplerate=sr, channels=2)
winsound.Beep(8000,1000)
sd.wait()
time.sleep(1)
sd.play(myrecording, sr)
sf.write("LongBeep.wav", myrecording, sr)