Ecasound Sample Rate Conversion for Mixed Audio

This article explains how the Ecasound command-line audio processor handles mismatched sample rates when importing and mixing audio tracks. You will learn about Ecasound’s global engine format, how it utilizes resampling libraries like libsamplerate, the default behaviors when handling mixed files, and how to avoid playback speed and pitch anomalies during multitrack processing.

The Global Processing Format

Ecasound processes audio using a unified internal format defined across an entire chainsetup. Unlike modern digital audio workstations that automatically resample every input to a project rate in the background without user intervention, Ecasound relies on an explicit engine processing format.

This format is set using the -f flag (e.g., -f:s16_le,2,44100 for 16-bit little-endian, 2-channel, 44.1 kHz audio). When an engine is launched, all active chains and processing operations execute at this defined global sample rate.

Handling Mixed Sample Rates

When importing audio files with varying sample rates into a single session, Ecasound must reconcile the differences against the target engine rate:

Best Practices for Mixing Different Formats

To ensure clean output when working with mixed sample rates in Ecasound:

  1. Establish the Master Rate: Determine the master sample rate based on your hardware output or intended export target using the -f option.
  2. Verify Engine Capabilities: Check your Ecasound build configuration using ecasound --version to ensure that audio conversion libraries (libsamplerate) are enabled.
  3. Pre-render When Necessary: For complex sessions involving numerous tracks with varying sample rates, pre-converting source files to a single, uniform sample rate using tools like SoX or Ecasound batch scripts minimizes CPU overhead and avoids real-time buffer underruns during live processing.