11 stable releases

new 1.2.4 Jan 15, 2025
1.2.3 Sep 13, 2024
1.2.2 Jan 30, 2024
1.2.1 Aug 30, 2023
1.0.1 Oct 8, 2021

#77 in Audio

Download history 117/week @ 2024-09-27 110/week @ 2024-10-04 64/week @ 2024-10-11 52/week @ 2024-10-18 28/week @ 2024-10-25 30/week @ 2024-11-01 15/week @ 2024-11-08 25/week @ 2024-11-15 16/week @ 2024-11-22 46/week @ 2024-11-29 191/week @ 2024-12-06 101/week @ 2024-12-13 45/week @ 2024-12-20 32/week @ 2024-12-27 80/week @ 2025-01-03 220/week @ 2025-01-10

385 downloads per month

Apache-2.0

11MB
540 lines

Contains (Windows DLL, 1MB) libpv_recorder.dll, (ELF lib, 570KB) data/lib/beaglebone/libpv_recorder.so, (ELF lib, 750KB) libpv_recorder.so, (ELF lib, 1MB) data/lib/linux/x86_64/libpv_recorder.so, (Mach-o library, 625KB) data/lib/mac/arm64/libpv_recorder.dylib, (Mach-o library, 720KB) data/lib/mac/x86_64/libpv_recorder.dylib and 9 more.

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.

Requirements

  • Rust 1.54+

Compatibility

  • Linux (x86_64)
  • macOS (x86_64 and arm64)
  • Windows (x86_64 and arm64)
  • Raspberry Pi:
    • Zero
    • 3 (32 and 64 bit)
    • 4 (32 and 64 bit)
    • 5 (32 and 64 bit)

Installation

To add the pvrecorder library into your app, add pv_recorder to your app's Cargo.toml manifest:

[dependencies]
pv_recorder = "*"

Usage

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

use pv_recorder::PvRecorderBuilder

let audio_devices = PvRecorderBuilder::default().get_audio_devices()?;

To start recording, initialize an instance using the builder and call start():

use pv_recorder::PvRecorderBuilder;

let frame_length = 512;
let recorder = PvRecorderBuilder::new(frame_length).init()?;
recorder.start()?

Read frames of audio:

while recorder.is_recording() {
    let frame = recorder.read()?;
    // process audio frame
}

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

recorder.stop()?;

Demo

The PvRecorder Rust demo is a Rust command-line application that demonstrates how to use PvRecorder to record audio to a file.

Dependencies