Create Voice Recorder Using Phyton

Haii, read the title make us wonder how can we create voice recorder using phyton, is that possible? the answer is yes, of course!
In this article i will show you how to record audio using python package used are sounddevice for recording sound and scipy for saving it in an audio file
This Python module provides bindings for the PortAudio library and a few convenience functions to play and record NumPy arrays containing audio signals.
So, here you are
First thing first open the command Prompt. As usual, we have to install some packages at the command prompt in order to run the program. We gonna use sounddevice and also scipy
pip install sounddevice

after sounddevice successful install, continuous to the next package that is scipy
pip install scipy

Then, for the next steps, open notepad++ or sublime and write down this script
import sounddevice
from scipy.io.wavfile import writefs=44100
second=10
print("recording.....")
record_voice=sounddevice.rec(int(second*fs),samplerate=fs,channels=2)
sounddevice.wait()
write("output.wav",fs,record_voice)
Then save the script into the “recordbypython” folder on disk C so that it will appear (C: \ recordbypython) and save the following script in python (.py) form, namely 1.py in the “recordbypython” folder

Once saved, return to the command prompt and do the command as follows.
C:\recordbypyhton>python 1.py

The words “recording ….” means that the system is recording our voice. In this case i say “hai, namaku zada”. We can record everything that we want. When we know the record is over? it’s when “C: \ recordbypython>” appears, means that the recording is complete. It will automatically save on and you can see the results in the “recordbypython” folder.

From the folder above we can see that there is an “output” file it means that our record has been successfully created.

You can listen to my own recordings by click here
So thats all about Voice Recorder Using Phyton. you can explore more. i hope this is useful and have a nice day for all of you guys
Referensi Utama:
- https://www.youtube.com/watch?v=lWxaIZl5-Nk
- Nisa, Farhatun. (2020, Januari 29). Membuat Voice Recorder Menggunakan Python. https://medium.com/@farhatunnissa24/membuat-voice-recorder-menggunakan-python-6ce520505516