Skip to main content

A realtime audio recording scripts

Project description

rcaudio : A Realtime Audio Recording & Analyze Script

Introduction

rcaudio Rcaudio is a real-time audio analysis library that allows you to simply record audio through a microphone and analyze.

It supports real-time analysis of :

  • The raw audio data
  • Volume
  • Beat Information

For chinese documentation : 中文文档

Usage

CoreRecorder

CoreRecorder is used to fetch raw data. When started, the audio data will be stored in the CoreRecorder.buffer.

from rcaudio import CoreRecorder
CR = CoreRecorder(
        time = 10, #How much time to record
        sr = 1000 #sample rate
        )
CR.start()
while True:
    if not CR.buffer.empty():
        x = CR.buffer.get()
        print('*'*int(abs(x)))

SimpleRecorder

In most cases, we use SimpleRecorder. For efficiency consideration, the SimpleRecorder should only be instantiated once.

This class can register several Analyzer.

When the function start() called, It will begin to record through microphone, and refresh the status of all the Analyzer

Analyzers

All class extended from BaseAnalyzer can be registered into SimpleRecorder. For example VolumeAnalyzer can get the current volume of the microphone.

SR = SimpleRecorder()
VA = VolumeAnalyzer(rec_time = 1)
SR.register(VA)
SR.start()
while True:
    print("VOLUME : ",VA.get_volume())
    time.sleep(1)

And beat analyzer can predict the beats from the music. (However, there will be some delay.)

SR = SimpleRecorder(sr = 20000)
BA = BeatAnalyzer(rec_time = 15, initial_bpm = 120, smooth_ratio = .8)
SR.register(BA)
SR.start()
while True:
    print(BA.block_until_next_beat())

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

rcaudio-0.0.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

rcaudio-0.0.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file rcaudio-0.0.1.tar.gz.

File metadata

  • Download URL: rcaudio-0.0.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5

File hashes

Hashes for rcaudio-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a180bb559328bbabf63b6a35fcccbcf4003f9c638e678db6ee827bd0013b316b
MD5 b47fe6e7ab3ed53037f2509e113c9f05
BLAKE2b-256 26037a31078e680fd9e33b0838af3dd11245771035a7fc6fc2c32dce559a8d61

See more details on using hashes here.

File details

Details for the file rcaudio-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: rcaudio-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5

File hashes

Hashes for rcaudio-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 77bf9398d37716de72ac94ef81cba1370bdf2375dbff47aa6aca6de6e9acf6e8
MD5 56d9bb4b0d3f2b652fdd552c48b32407
BLAKE2b-256 55d41aa0502afabf2c5f93b77052bddbe2af74fe3184a0d49cc57e36b76750b1

See more details on using hashes here.

Supported by

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