Skip to main content

Recorder library for Picovoice.

Project description

PvRecorder Binding for Python

PvRecorder

PvRecorder is an easy-to-use, cross-platform audio recorder designed for real-time speech audio processing. It allows developers access to an audio device's input stream, broken up into data frames of a given size.

Compatibility

  • Python 3.9+
  • Runs on Linux (x86_64), macOS (x86_64 and arm64), Windows (x86_64 and arm64), and Raspberry Pi (Zero, 3, 4, 5).

Installation

pip3 install pvrecorder

Usage

Initialize and begin recording:

from pvrecorder import PvRecorder

recorder = PvRecorder(frame_length=512)
recorder.start()

(or)

Use get_available_devices() to get a list of available devices and then initialize the instance based on the index of a device:

from pvrecorder import PvRecorder

devices = PvRecorder.get_available_devices()

recorder = PvRecorder(frame_length=512, device_index=0)
recorder.start()

Read frames of audio:

while recorder.is_recording:
    frame = recorder.read()
    # process audio frame

To stop recording, call stop() on the instance:

recorder.stop()

Once you are done, free the resources acquired by PvRecorder. You do not have to call stop() before delete():

recorder.delete()

Demos

pvrecorderdemo provides command-line utilities for recording audio to a file.

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

pvrecorder-1.2.7.tar.gz (4.1 MB view details)

Uploaded Source

Built Distribution

pvrecorder-1.2.7-py3-none-any.whl (4.1 MB view details)

Uploaded Python 3

File details

Details for the file pvrecorder-1.2.7.tar.gz.

File metadata

  • Download URL: pvrecorder-1.2.7.tar.gz
  • Upload date:
  • Size: 4.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for pvrecorder-1.2.7.tar.gz
Algorithm Hash digest
SHA256 f60b2174bff317c4349a916f59b5e71914a120f8313a9458f9ee25b89a800c75
MD5 e610890eec35acb75872507baba34032
BLAKE2b-256 7b93972f2500bca8e2b7807f2c6232504df4f1b82db546e42fdd2de109b98032

See more details on using hashes here.

File details

Details for the file pvrecorder-1.2.7-py3-none-any.whl.

File metadata

  • Download URL: pvrecorder-1.2.7-py3-none-any.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for pvrecorder-1.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 72c44be78069be92a602b0dfad42fbdc62b536f47c151e62076ee49ba877dfb0
MD5 25231b731200566b2cf6bcba9dc67f49
BLAKE2b-256 f64cb1706065a9b52efa9a23e3822076b8916de2ff26036b6ff1474d90f95c95

See more details on using hashes here.

Supported by

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