8 stable releases

1.2.1 Aug 30, 2023
1.2.0 Jul 13, 2023
1.1.2 May 1, 2023
1.1.1 Apr 17, 2023
1.0.0 Sep 7, 2021

#56 in Audio

Download history 94/week @ 2023-06-06 67/week @ 2023-06-13 72/week @ 2023-06-20 56/week @ 2023-06-27 38/week @ 2023-07-04 124/week @ 2023-07-11 44/week @ 2023-07-18 32/week @ 2023-07-25 32/week @ 2023-08-01 38/week @ 2023-08-08 33/week @ 2023-08-15 25/week @ 2023-08-22 101/week @ 2023-08-29 25/week @ 2023-09-05 48/week @ 2023-09-12 154/week @ 2023-09-19

333 downloads per month

Apache-2.0

9MB
543 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, 605KB) data/lib/mac/arm64/libpv_recorder.dylib, (Mach-o library, 720KB) data/lib/mac/x86_64/libpv_recorder.dylib and 6 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)
  • Raspberry Pi:
    • Zero
    • 2
    • 3 (32 and 64 bit)
    • 4 (32 and 64 bit)
  • NVIDIA Jetson Nano
  • BeagleBone

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