Skip to main content

Provides simple interface for recording audio

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

week1_test-1.2.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

week1_test-1.2.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file week1_test-1.2.1.tar.gz.

File metadata

  • Download URL: week1_test-1.2.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.3

File hashes

Hashes for week1_test-1.2.1.tar.gz
Algorithm Hash digest
SHA256 ed38e781aab09d503fd51fbb0b4b410e3ad4ecbdc2ff5ed533676933345d1251
MD5 fd267fa74cba39845c92c9c458aafdf6
BLAKE2b-256 aef9eb71efc71961cba085fa5e8dc2e9c44c010d748a15b56378d7241f4ef746

See more details on using hashes here.

File details

Details for the file week1_test-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: week1_test-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.3

File hashes

Hashes for week1_test-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4aacae7926ce2af482929ed727e06a51e0e086c0ede070b40bdd317b5a7c493e
MD5 8b4b31a6b6afba16d426415626822bdf
BLAKE2b-256 5964a84233e4e8d0ad89a73a2538dfcb1b870340276c52a0747ec5da85ef1dc6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page