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.5+
- Runs on Linux (x86_64), macOS (x86_64 and arm64), Windows (x86_64), Raspberry Pi (all variants), NVIDIA Jetson (Nano), and BeagleBone.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pvrecorder-1.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ac2fd7ddc74fadd097ef538a3556da1bb540d7f039a8e43dccfbf8c015a9bb1 |
|
MD5 | af3ffd567db226e445ef9e9340c9a0c1 |
|
BLAKE2b-256 | cfd02931e67c64f719789b645e652f7d093d93f9fb62504922bcf365a8d0213c |