Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sounddevice
- from scipy.io.wavfile import write
- fs=44100
- second=int(input("Mời nhập thời gian ghi âm ")) #Nhập vào khoảng thời gian muốn ghi âm
- print("Đang ghi âm....\n")
- record_voice=sounddevice.rec(int(second * fs),samplerate=fs,channels=2)
- sounddevice.wait()
- write("out.wav",fs,record_voice)
- print("Thành công...\nHãy mở file ghi âm để kiểm tra...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement