GithubHelp home page GithubHelp logo

a-lohia / microphone Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cogworksbwsi/microphone

0.0 0.0 0.0 23 KB

Convenient tooling for configuring & utilizing a microphone in Python

Python 100.00%

microphone's Introduction

Microphone

Provides a simple interface for configuring and utilizing a microphone in Python.

This package has been tested using Python 3.7, using conda 4.7.5, on both Mac and Windows 10.

Installing pyaudio (required dependency)

conda install pyaudio

Installing this package

Once you have installed the dependencies, clone this repository, navigate to it, and run

pip install -e .

It is important that you use this develop install option, as the microphone configuration requires that this package is installed in-place.

Configuring Your Microphone

Now we will configure microphone to use the appropriate microphone on your computer. Navigate to Microphone/microphone and run:

python configure_input.py

and follow the selection prompt. This will save your microphone preference for future use. The resulting configuration file will be saved to Microphone/microphone/config.ini. The contents of the file will look something like this

[input device]
name = Desktop Microphone (RØDE NT-USB)
index = 1

You can edit this file to change the recording settings (e.g. the sampling rate) used to sampled audio from your microphone.

Testing Your Microphone

Navigate to Microphone and run:

python test_input.py

This should record and play back a brief audio clip using the microphone selected during configuration.

Recording Audio

from microphone import record_audio

# Record 10 seconds of audio
byte_encoded_signal, sampling_rate = record_audio(10)

Playing Audio

from microphone import play_audio

# Play 10 seconds of audio
play_audio(byte_encoded_signal, 10)

microphone's People

Contributors

rsokl avatar petarmhg avatar a-lohia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.