# Audio Chunk Size Requirements and 48kHz Sample Rate Handling in Meetily

> Master Meetily's audio pipeline with a 48kHz sample rate. Discover chunk size requirements for denoising mixing and recording 480 2400 and 48000 samples.

- Repository: [Zackriya Solutions/meetily](https://github.com/Zackriya-Solutions/meetily)
- Tags: deep-dive
- Published: 2026-07-17

---

**Meetily enforces a strict 48kHz sample rate across its entire audio pipeline, processing audio in specific chunk sizes including 480-sample frames (10ms) for RNNoise denoising, 2,400-sample windows (50ms) for mixing, and 48,000-sample buffers (1s) for recording storage.**

Meetily is an open-source meeting recorder that standardizes all audio processing on a **48kHz sample rate** to ensure compatibility between noise suppression, mixing, and transcription components. Regardless of whether audio originates from a microphone, system capture, or imported files, the pipeline resamples everything to this canonical rate before processing. This architectural decision eliminates sample rate mismatches that could otherwise degrade audio quality or break downstream processing.

## Why Meetily Requires 48kHz Sample Rate

The 48kHz requirement is hardcoded throughout Meetily's Rust audio stack to guarantee predictable behavior across hardware variations. In [`frontend/src-tauri/src/audio/audio_processing.rs`](https://github.com/Zackriya-Solutions/meetily/blob/main/frontend/src-tauri/src/audio/audio_processing.rs), the `NoiseSuppressionProcessor::new` constructor explicitly validates the sample rate:

```rust
// Create a noise‑suppression processor – must be 48 kHz
let mut ns = NoiseSuppressionProcessor::new(48_000)
    .expect("Audio must be 48 kHz");

```

If a different rate is supplied, the processor returns an error immediately【/frontend/src-tauri/src/audio/audio_processing.rs#L44-L52】. This validation ensures that RNNoise (the noise suppression library) receives its required format, as the algorithm is optimized specifically for 48kHz PCM audio.

The **Audio Buffer Pool** also assumes this baseline. In [`recording_state.rs`](https://github.com/Zackriya-Solutions/meetily/blob/main/recording_state.rs), buffers are allocated to hold exactly 48,000 samples—representing one second of audio at the canonical rate【/frontend/src-tauri/src/audio/recording_state.rs#L139-L140】. Any deviation would cause buffer overruns or underruns during recording.

## Audio Chunk Sizes and Processing Windows

Meetily slices the continuous 48kHz stream into discrete chunks sized for specific processing stages. These chunk sizes balance **latency** against **processing efficiency**:

- **RNNoise Denoising**: 480 samples (10ms at 48kHz). Defined as `FRAME_SIZE` in [`audio_processing.rs`](https://github.com/Zackriya-Solutions/meetily/blob/main/audio_processing.rs), this matches RNNoise's internal frame expectations【/frontend/src-tauri/src/audio/audio_processing.rs#L30-L41】.

- **Audio Mixing**: 2,400 samples (50ms at 48kHz). The [`ffmpeg_mixer.rs`](https://github.com/Zackriya-Solutions/meetily/blob/main/ffmpeg_mixer.rs) implementation aggregates microphone and system audio into these windows for professional-grade mixing【/frontend/src-tauri/src/audio/ffmpeg_mixer.rs#L488】.

- **Recording Buffers**: 48,000 samples (1s at 48kHz). The buffer pool allocates slots of this size to hold one-second segments before writing to disk.

- **Incremental Checkpoints**: 1,440,000 samples (30s at 48kHz). Long recordings flush to disk in 30-second chunks to prevent data loss.

This tiered approach allows real-time denoising on 10ms frames while maintaining efficient I/O operations on larger time slices.

## Sample Rate Normalization Flow

When hardware reports a non-48kHz native rate (common with Bluetooth headsets at 8kHz, 16kHz, or 44.1kHz), Meetily's resampler intercepts the stream before it enters the core pipeline.

The normalization occurs in three stages:

1. **Device Capture**: Raw audio arrives at the hardware's native sample rate (8kHz, 16kHz, 44.1kHz, etc.).
2. **Resampling**: The `audio_v2::resampler` module performs sinc-based interpolation to convert the stream to 48kHz.
3. **Pipeline Processing**: The unified 48kHz stream feeds into RNNoise (480-sample frames), mixing (2,400-sample windows), and finally Whisper transcription.

The Voice Activity Detection (VAD) module receives 48kHz audio and handles its own internal downsampling to 16kHz as needed【/frontend/src-tauri/src/audio/pipeline.rs#L723】.

```rust
// Resample an arbitrary source stream to 48 kHz
let src_rate = 44_100; // e.g., from a Bluetooth headset
let mut resampler = audio_v2::resampler::Resampler::new(src_rate, 48_000);
let upsampled = resampler.process(&raw_samples);

```

## Implementation Details and Code Examples

The following Rust patterns demonstrate the 48kHz contract in Meetily's source:

Processing a single RNNoise frame requires exactly 480 samples:

```rust
// Process an incoming block of 480‑sample (10 ms) audio
let processed = ns.process(&mic_samples);

```

Allocating the buffer pool for recording:

```rust
// Allocate a 1‑second buffer pool (48 000 samples)
let pool = AudioBufferPool::new(16, 48_000);
let buffer = pool.acquire(); // holds exactly one second of audio

```

## Key Source Files

The 48kHz architecture spans these critical files in the `frontend/src-tauri/src/audio/` directory:

- **[`audio_processing.rs`](https://github.com/Zackriya-Solutions/meetily/blob/main/audio_processing.rs)**: Implements RNNoise integration, validates the 48kHz requirement, and defines `FRAME_SIZE = 480`【/frontend/src-tauri/src/audio/audio_processing.rs】.

- **[`pipeline.rs`](https://github.com/Zackriya-Solutions/meetily/blob/main/pipeline.rs)**: Orchestrates the resampling, manages mixing windows, and coordinates VAD handling at the 48kHz baseline【/frontend/src-tauri/src/audio/pipeline.rs】.

- **[`constants.rs`](https://github.com/Zackriya-Solutions/meetily/blob/main/constants.rs)**: Houses canonical constants including `FRAME_SIZE` and documentation of the 48kHz sample rate requirement.

- **[`audio_v2/resampler.rs`](https://github.com/Zackriya-Solutions/meetily/blob/main/audio_v2/resampler.rs)**: Performs high-quality sinc-based sample rate conversion to align hardware inputs with the 48kHz pipeline.

- **[`ffmpeg_mixer.rs`](https://github.com/Zackriya-Solutions/meetily/blob/main/ffmpeg_mixer.rs)**: Combines multiple audio streams using 2,400-sample (50ms) mixing windows【/frontend/src-tauri/src/audio/ffmpeg_mixer.rs】.

- **[`recording_state.rs`](https://github.com/Zackriya-Solutions/meetily/blob/main/recording_state.rs)**: Manages buffer pools sized for 48,000-sample (1-second) segments【/frontend/src-tauri/src/audio/recording_state.rs】.

- **[`audio_v2/recorder.rs`](https://github.com/Zackriya-Solutions/meetily/blob/main/audio_v2/recorder.rs)**: Instantiates the capture engine with a default 48kHz configuration.

## Summary

- Meetily mandates **48kHz sample rate** for all audio processing to ensure compatibility between RNNoise, mixing, and transcription components.
- **RNNoise processing** occurs on strict 480-sample frames (10ms), returning an error if the rate differs from 48kHz.
- **Mixing operations** use 2,400-sample windows (50ms) to combine microphone and system audio streams.
- **Recording buffers** allocate 48,000 samples (1s) per slot, with incremental saves flushing every 1,440,000 samples (30s).
- The **resampler** automatically converts 8kHz, 16kHz, 44.1kHz, and other hardware rates to 48kHz before processing begins.

## Frequently Asked Questions

### What happens if my audio device doesn't support 48kHz?

Meetily automatically resamples incoming audio using the `audio_v2::resampler` module. Whether your device provides 8kHz, 16kHz, or 44.1kHz, the pipeline converts it to 48kHz before any processing occurs. This happens transparently without user intervention, though the conversion adds negligible CPU overhead.

### Why is the RNNoise frame size fixed at 480 samples?

The 480-sample frame corresponds exactly to 10ms of audio at 48kHz, which is the native frame size required by the RNNoise library. In [`audio_processing.rs`](https://github.com/Zackriya-Solutions/meetily/blob/main/audio_processing.rs), the `FRAME_SIZE` constant is set to 480, and the `NoiseSuppressionProcessor` validates this alignment at initialization. Using different frame sizes would cause the noise suppression algorithm to fail or produce artifacts.

### How does Meetily handle mixing of microphone and system audio?

The mixer in [`ffmpeg_mixer.rs`](https://github.com/Zackriya-Solutions/meetily/blob/main/ffmpeg_mixer.rs) accumulates audio into 2,400-sample windows (50ms at 48kHz) before combining streams. This buffer size provides sufficient data for FFmpeg to perform professional-quality mixing while maintaining low latency. Both input streams must be resampled to 48kHz before entering the mixer to ensure synchronization.

### Does the 48kHz requirement affect transcription accuracy?

While Meetily processes audio at 48kHz throughout its pipeline, the Whisper transcription engine internally downsamples to 16kHz for speech recognition. The Voice Activity Detection (VAD) module in [`pipeline.rs`](https://github.com/Zackriya-Solutions/meetily/blob/main/pipeline.rs) handles this conversion automatically, noting that it manages the 48kHz to 16kHz transition internally. The high upstream sample rate preserves audio quality for noise suppression and mixing before the final transcription step.