Functional Difference Between Meetily's microphone.rs and system.rs Audio Capture Modules

The functional difference between Meetily's microphone.rs and system.rs audio capture modules is that microphone.rs is currently a placeholder stub awaiting implementation, while system.rs provides a complete, production-ready system for capturing computer audio output using platform-specific APIs like Core Audio taps on macOS.

Meetily, an open-source meeting transcription tool developed by Zackriya-Solutions, separates audio acquisition into distinct capture modules to handle different input sources. Understanding the functional difference between Meetily's microphone.rs and system.rs audio capture modules is essential for contributors working with the Rust-based audio pipeline. While both modules reside in the frontend/src-tauri/src/audio/capture/ directory, they serve fundamentally different purposes in the application's architecture.

Architectural Purpose and Current State

microphone.rs as a Future-Focused Stub

The microphone.rs module is currently a placeholder containing only a TODO comment indicating that streaming logic will be moved from the legacy core.rs file during a future refactor. According to the source code in frontend/src-tauri/src/audio/capture/microphone.rs, the module is intended to eventually capture raw microphone input (the user's voice) and return a Stream<Item = f32>. However, it currently exposes no public functions and serves as a structural placeholder for the "Recording Path" integration.

system.rs as the Production Implementation

In contrast, frontend/src-tauri/src/audio/capture/system.rs contains a fully implemented system audio capture solution. This module captures the computer's system/audio output (such as speaker or virtual audio devices) for recording or VAD-filtered transcription. The implementation uses Core Audio taps (CoreAudioCapture) on macOS and is designed to fall back to WASAPI on Windows or ALSA/PulseAudio on Linux, though those backends remain unimplemented in the current codebase.

Technical Implementation and Platform Support

Core Audio Taps and Cross-Platform Design in system.rs

The system.rs module uses conditional compilation via #[cfg(target_os = "macos")] to route audio capture through Core Audio taps. On non-macOS platforms, the code explicitly fails with bail!("System audio capture not yet implemented for this platform") using the anyhow::Result error handling pattern. The module returns a SystemAudioStream type that implements Stream<Item = f32> and provides a sample_rate() accessor method for audio pipeline configuration.

The Unimplemented State of microphone.rs

While microphone.rs will eventually rely on CPAL's input-device handling (mirroring helper functions in frontend/src-tauri/src/audio/devices/microphone.rs), the current implementation contains no platform-specific logic. The module awaits extraction of microphone AudioStream logic from core.rs, with error handling patterns likely to follow the same anyhow::Result conventions established in system.rs.

Public API and Pipeline Integration

System Audio Stream Interface

The system.rs module exposes three key public functions that microphone.rs currently lacks:

  • pub async fn start_system_audio_capture() -> Result<SystemAudioStream> – Initiates the audio stream.
  • pub fn list_system_audio_devices() -> Result<Vec<String>> – Enumerates available output devices.
  • pub fn check_system_audio_permissions() -> bool – Verifies application access to system audio.

When capturing system audio on macOS, the application requires Screen Recording permission to create the Core Audio tap, which check_system_audio_permissions() validates alongside standard audio device enumeration capabilities.

Microphone Integration Points

While microphone.rs currently provides no public API, the planned implementation will serve the Recording Path in frontend/src-tauri/src/audio/pipeline.rs, where microphone audio mixes with system audio before being saved. The system.rs module, however, feeds the Transcription Path, providing speech-only chunks (after Voice Activity Detection filtering) to the Whisper transcription engine.

Working with system.rs: Practical Examples

Because microphone.rs remains unimplemented, production code currently uses only the system audio capture capabilities. The following example demonstrates starting system audio capture and enumerating devices on macOS:

use frontend::src_tauri::audio::capture::system::{
    start_system_audio_capture, 
    list_system_audio_devices
};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // List available output devices (useful for selecting a virtual audio device)
    let devices = list_system_audio_devices()?;
    println!("System audio devices: {:?}", devices);

    // Start capturing system audio
    let mut stream = start_system_audio_capture().await?;
    println!("Capture started – sample rate: {} Hz", stream.sample_rate());

    // Example: read first few samples
    for _ in 0..5 {
        if let Some(sample) = stream.next().await {
            println!("Sample: {}", sample);
        }
    }
    Ok(())
}

When microphone.rs is fully implemented, the API will likely resemble the system audio pattern:

// Anticipated implementation (currently stubbed in microphone.rs):
// let mic_stream = start_microphone_capture().await?;
// while let Some(sample) = mic_stream.next().await {
//     // Process microphone audio for the Recording Path
// }

Summary

  • microphone.rs is a future-focused stub located at frontend/src-tauri/src/audio/capture/microphone.rs, containing only a TODO comment indicating future extraction from core.rs.
  • system.rs is a complete, platform-aware implementation at frontend/src-tauri/src/audio/capture/system.rs, using Core Audio taps on macOS to capture system output.
  • The system audio module exposes start_system_audio_capture(), list_system_audio_devices(), and check_system_audio_permissions() for full pipeline integration.
  • Recording Path requires microphone input (future) mixed with system audio, while the Transcription Path uses VAD-filtered system audio exclusively.
  • Both modules eventually return Stream<Item = f32> types, but only system.rs currently implements the streaming interface.

Frequently Asked Questions

Why is microphone.rs just a stub while system.rs is fully implemented?

The Meetily development team prioritizes capturing system audio for transcription purposes, as this allows recording meeting participants' voices through the computer's output. The microphone capture logic currently resides in core.rs and will be refactored into microphone.rs in a future update to separate concerns between user voice input and system audio processing.

What permissions are required for system audio capture on macOS?

According to the implementation in system.rs, capturing system audio on macOS requires Screen Recording permission to create Core Audio taps that read playback samples. The check_system_audio_permissions() function verifies this access before attempting to start the capture stream; failure results in a permission error that must be resolved in System Preferences.

How does the audio pipeline differentiate between microphone and system audio?

In frontend/src-tauri/src/audio/pipeline.rs, the Recording Path mixes both microphone audio (when implemented) and system audio for complete meeting records, while the Transcription Path routes only system audio through Voice Activity Detection (VAD) before sending clean speech chunks to the Whisper engine. This separation ensures transcription quality while preserving full audio context for recordings.

Will microphone.rs use the same streaming interface as system.rs?

Yes, the TODO comment in microphone.rs indicates it will return a Stream<Item = f32> similar to SystemAudioStream, maintaining API consistency across capture modules. Both will use anyhow::Result for error handling and integrate with the device discovery helpers in frontend/src-tauri/src/audio/devices/microphone.rs for CPAL-based input device management.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →