Skip to content

arthurhrk/audio-recorder-manager

Repository files navigation

Audio Recorder Manager

A high-performance command-line audio recorder manager built with Rust, converted from the Python version for improved performance and reliability.

Acknowledgments

This project was inspired by and based on the Python implementation from MeetingScribe by Arthur Andrade. The original Python code served as the foundation for this Rust implementation, which maintains full CLI compatibility while providing significant performance improvements.

Features

  • Record audio from available devices (system audio/loopback on Windows)
  • Real-time status updates during recording
  • JSON-based status files for frontend integration
  • Manual recording mode with stop signals
  • Professional quality audio (48kHz, 16-bit, stereo)
  • Compatible with existing Python CLI interface

Quick Start

Download Pre-built Binary

Windows users can download the pre-built executable from the latest release:

  1. Download audio-recorder-manager.exe
  2. Run it directly - no installation required!
# Start recording
audio-recorder-manager.exe record 30 wav

Build from Source

Requirements

Windows

Linux

sudo apt-get install libasound2-dev pkg-config

macOS

No additional dependencies required.

Installation

cargo build --release

The compiled binary will be in target/release/audio-recorder-manager.exe (Windows) or target/release/audio-recorder-manager (Linux/macOS).

Usage

This Rust version maintains full compatibility with the Python CLI interface:

# Start recording for 30 seconds (default)
audio-recorder-manager record 30 wav

# Manual mode - record until stop signal
audio-recorder-manager record -1 wav

# Check system audio devices
audio-recorder-manager status

Output Format

All commands return JSON for easy integration with frontends:

{
  "status": "success",
  "data": {
    "session_id": "rec-20250107_123456",
    "file_path": "storage/recordings/recording_20250107_123456.wav",
    "filename": "recording_20250107_123456.wav",
    "duration": 30,
    "message": "Recording started successfully"
  }
}

Status Files

Recording status is written to storage/status/{session_id}.json every second:

{
  "status": "recording",
  "session_id": "rec-20250107_123456",
  "filename": "recording_20250107_123456.wav",
  "duration": 30,
  "elapsed": 15,
  "progress": 50,
  "quality": "professional",
  "device": "Default Audio Device",
  "sample_rate": 48000,
  "channels": 2,
  "frames_captured": 1500,
  "has_audio": true
}

Manual Stop

To stop a manual recording, create a stop signal file:

# File: storage/signals/{session_id}.stop
touch storage/signals/rec-20250107_123456.stop

Architecture

  • devices.rs: Audio device detection and management using cpal
  • recorder.rs: Audio recording with real-time status updates
  • main.rs: CLI interface matching Python implementation

Performance Improvements over Python

  • Zero-overhead audio capture with Rust's type system
  • Lock-free atomic operations for frame counting
  • Efficient memory management without GC pauses
  • Native threading with Tokio async runtime
  • Direct WAV file writing without intermediate buffers

Development

# Check for compilation errors
cargo check

# Run with logging
RUST_LOG=debug cargo run -- record 5 wav

# Run tests
cargo test

# Build optimized release
cargo build --release

UI Preview (GPUI prototype)

The repository now includes a GPUI/GPUI Component-based frontend under ui/. The UI reads the same storage/ directory generated by the CLI and focuses on quick inspection of sessions, recordings and transcripts.

# Run the desktop UI (requires the gpui dependencies)
cargo run -p audio-recorder-ui -- \
  --storage-dir "C:/path/to/storage" \
  --session "rec-20250107_123456"

The UI binary accepts CLI arguments so you can trigger it from Raycast/Automations:

  • --storage-dir DIR: override the storage root (takes precedence over AUDIO_RECORDER_STORAGE_DIR).
  • --session ID: focus a specific recording as soon as the window opens (useful when launching from Raycast actions).

Because .cargo/config.toml defaults to the GNU toolchain, make sure a MinGW gcc is installed or pass an explicit target (e.g. cargo run --target x86_64-pc-windows-msvc ...) if you prefer the MSVC toolchain.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •