Skip to main content

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.

Release files for pvrecorder 1.2.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pvrecorder 1.2.7
File Size Uploaded
pvrecorder-1.2.7.tar.gz 4.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pvrecorder 1.2.7
File Interpreter ABI Platform
pvrecorder-1.2.7-py3-none-any.whl Python 3 none any Details

Total release size: 8.3 MB

Release files / pvrecorder-1.2.7.tar.gz

Download URL pvrecorder-1.2.7.tar.gz
Size 4.1 MB
Tags Source
SHA-256 checksum
How to use checksums
f60b2174bff317c4349a916f59b5e71914a120f8313a9458f9ee25b89a800c75
BLAKE2b-256 checksum
How to use checksums
7b93972f2500bca8e2b7807f2c6232504df4f1b82db546e42fdd2de109b98032
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / pvrecorder-1.2.7-py3-none-any.whl

Download URL pvrecorder-1.2.7-py3-none-any.whl
Size 4.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
72c44be78069be92a602b0dfad42fbdc62b536f47c151e62076ee49ba877dfb0
BLAKE2b-256 checksum
How to use checksums
f64cb1706065a9b52efa9a23e3822076b8916de2ff26036b6ff1474d90f95c95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release history Release notifications | RSS feed

This release

1.2.7 This release

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page