#!/usr/bin/env python
# coding: utf-8
# In[13]:
pip install sounddevice
# In[14]:
pip install scipy
# # Voice Recorder in Python
# In[15]:
#import required modules
import sounddevice
from scipy.io.wavfile import write
#sample_rate
fs=44100
#Ask to enter the recording time
second=int(input("Enter the Recording Time in second: "))
print("Recording....\n")
record_voice=sounddevice.rec(int(second * fs),samplerate=fs,channels=2)
sounddevice.wait()
write("MyRecording.wav",fs,record_voice)
print("Recording is done Please check you folder to listen recording")
#clcoding.com
# In[ ]:
0 Comments:
Post a Comment