Recorder library for Picovoice.
Project description
PvRecorder Binding for Python
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
To start recording initialize an instance and run start:
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() # select index of device
recorder = PvRecorder(frame_length=512, device_index=0)
recorder.start()
Get a frame of audio by calling the read()
function:
frame = recorder.read()
# do something with frame
To stop recording just run stop on the instance:
recorder.stop()
Once you are done, free the used resources. 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
pvrecorder-1.2.0.tar.gz
(4.0 MB
view hashes)
Built Distribution
Close
Hashes for pvrecorder-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84af0df0acdb1c50c63fe9d2a71182e6c7684b481bade4b6e30187e4928a2451 |
|
MD5 | db1f404d91f5df7101301f01ca78cb91 |
|
BLAKE2b-256 | 74425290110690995f297372a970c7adaee97f18d34db9e3b26d07cbbb04308c |