simple-pulse-desktop-capture 0.1.1

Easily capture PulseAudio PCM audio from the default playback device
Documentation
  • Coverage
  • 21.05%
    4 out of 19 items documented0 out of 7 items with examples
  • Size
  • Source code size: 11.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 541.95 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 18s Average build duration of successful builds.
  • all releases: 18s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jorikvanveen

Simple pulse desktop audio capture

Capture PulseAudio desktop audio with ease.

Getting started

This crate exports the DesktopAudioRecorder struct, simply instantiate it with new and call .read_frame() in a loop to start recieving PCM audio data.

Example

This example captures desktop audio and prints the PCM data for 5 seconds before quitting.

use std::time::Instant;
let mut recorder = DesktopAudioRecorder::new("Experiment").unwrap();

let start = Instant::now();

loop {
    match recorder.read_frame() {
        Ok(data) => println!("{:?}", data),
        Err(e) => eprintln!("{}", e)
    };

    if Instant::now().duration_since(start).as_millis() > 5000 {
        break;
    }
}