code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| import sounddevice from scipy.io.wavfile import write
def sound_recorder(second): fs = 44100 print("Recording.... \n") record_voice = sounddevice.rec(int(second * fs), samplerate = fs, channels=2) sounddevice.wait()
write("out.wav", fs, record_voice)
print("Finished...\nPlease check it...")
if __name__== '__main__': second = int(input("Enter the time duration in second : ")) sound_recorder(second)
|
Author:
Slay
Permalink:
http://sean-baek.github.io/2022/09/20/2022-09-20-python-sound-recorder/
License:
Copyright (c) 2021 CC-BY-NC-4.0 LICENSE
Slogan:
Do you believe in DESTINY?