I have set up a flask application that records voice using python(sounddevice and pydub) libraries and converts it into text.
Application is running well on localhost but when I deployed the application on Amazon-ec2 instance it records blank file .
It doesn't show any error but it records nothing. Can anyone help how to solve this?
`
def record(self):
time.sleep(2)
samplerate = 8000
duration = 5 # seconds
filename = path+'yes.wav'
print("start")
mydata = sd.rec(int(samplerate * duration), samplerate=samplerate,channels=1, blocking=True)
print("end")
print(type(mydata))
sd.wait()
sf.write(filename, mydata, samplerate)`