Skip to content

yashgr01/Voice_recorder-with-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Simple Voice Recorder with Python

This project is a straightforward Python program that lets you record audio directly from your computer's microphone and save it as a sound file. It's a great way to explore how Python can interact with your computer's hardware!

What it Does

This program records audio for a specified duration (e.g., 10 seconds) and then saves that recording as a .wav (Waveform Audio File Format) file on your computer. It's like having a simple voice memo app built with Python.

Why is This Useful?

Quick Audio Notes: Record short voice memos or ideas.

Audio Data Collection: A basic way to capture audio for other projects (e.g., if you later want to analyze sound).

Hardware Interaction Learning: Shows how Python can "talk" to your microphone.

Beginner-Friendly: A good, clear example of using external libraries for a practical task.

How it Works (A Simple Look)

Think of it like giving instructions to a sound engineer:

"Get Ready to Listen!" (import sounddevice): We bring in a special Python tool called sounddevice. This tool acts like a bridge between Python and your computer's microphone.

"Get Ready to Save!" (from scipy.io.wavfile import write): We also bring in another tool from scipy (a science-focused library) specifically designed to write audio data into a standard sound file format called .wav.

"Start Recording!" (sounddevice.rec(...)): When you tell the program to start, sounddevice begins listening to your microphone. You tell it how long to listen for and at what quality (the samplerate is like how many tiny snapshots of sound it takes per second).

"Wait Until You're Done!" (sounddevice.wait()): The program then patiently waits until the recording time you set is complete. It doesn't move on until all the sound has been captured.

"Save It!" (write(...)): Once sounddevice has captured all the sound, the write tool takes that raw sound data and saves it neatly into the .wav file you specified.

Technologies Used

Python 3: The programming language this script is written in.

sounddevice library: Used for recording audio from the microphone.

scipy library: Specifically, scipy.io.wavfile is used to save the recorded audio into a WAV file format.

My Learning and Thoughts

This project was a cool hands-on experience for me in:

Interacting with Hardware: Understanding how Python can control external devices like a microphone.

Using Specialized Libraries: Discovering how sounddevice and scipy simplify complex tasks like audio recording and file saving.

Function Definition: Practicing how to write my own reusable functions (voice_recorder).

It's exciting to see a program that actually listens and creates a real-world file!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages