Skip to main content

Recorder library for Picovoice.

Project description

PV_Recorder

A cross platform audio recorder to read one channel and 16kHz samples.

Requirements

  • Python 3

Compatibility

  • Windows (amd64)
  • macOS
    • x86_64
    • arm64
  • Linux (x86_64)
  • Raspberry Pi:
    • Zero
    • 2
    • 3 (32 and 64 bit)
    • 4 (32 and 64 bit)
  • NVIDIA Jetson Nano
  • BeagleBone

Installation

pip3 install pvrecorder

Usage

Getting the list of input devices does not require an instance:

from pvrecorder import PVRecorder

devices = PVRecorder.get_audio_devices()

To start recording initialize the instance and run start:

from pvrecorder import PvRecorder

recorder = PvRecorder(device_index=-1, frame_length=512)
recorder.start()

Get the pcm frames by calling the read function:

pcm = recorder.read()
# do something with pcm

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()

Demo

For more detailed information on how to use the pv_recorder python sdk, please that a look at demo.py.

In the following instructions, we will refer to {AUDIO_DEVICE_INDEX} as the index of the audio device to use, and {OUTPUT_PATH} as the path to save the audio data in wav format.

{AUDIO_DEVICE_INDEX} defaults to -1 and {OUTPUT_PATH} can be empty if you wish to not save any data.

To show the available audio devices run:

python3 demo.py --show_audio_devices

To run audio recorder run:

python3 demo.py --audio_device_index {AUDIO_DEVICE_INDEX} --output_path {OUTPUT_PATH}

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.0.1.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pvrecorder-1.0.1-py3-none-any.whl (2.9 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pvrecorder-1.0.1.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pvrecorder-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1340747ff0fef33b247153f3874464c4f095fcfb5054fb6b5de6ddf7b8032a43
MD5 8801930237bf608176a5ec3d1056e51d
BLAKE2b-256 9dad446d99ae860ec086f852aa8814f34e92a6ce234ba0776e81b6c318e88179

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pvrecorder-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pvrecorder-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 017aa42f317bf80d93a69915aff12b2c180ba1737bc544bcd831f49f278fe7d0
MD5 fee778a04e885b9f3570e9ebe060df4d
BLAKE2b-256 f1472355654643dd000428195161a8957596def214c0c053e50810563e3caf6e

See more details on using hashes here.

Supported by

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