Check File Duration and Sample Count in Ecasound
This guide explains how to view the overall duration and total sample count of audio files loaded into Ecasound. Whether running an interactive Ecasound session or working directly from the command line, understanding these inspection commands ensures accurate audio processing, timeline tracking, and session management.
The Primary Command:
cs-status
In Ecasound's interactive mode (IAM), the command used to display the overall duration and sample count of loaded files in the current chainsetup is:
cs-status
When you enter cs-status, Ecasound queries the active
chainsetup and outputs detailed session information. If audio files are
loaded as inputs, the output displays the total length of the session in
both seconds and total samples:
Chainsetup 'default' (status: stopped)
...
Length: 184.50s (8136450 samples)
...
Obtaining Raw Values Programmatically
If you are automating Ecasound via the Control Interface (ECA-control) or need only the raw values without parsing status text, use the dedicated query commands:
cs-get-length: Returns the total duration of the current chainsetup in seconds.cs-get-length-samples: Returns the exact overall length formatted as a sample count.
Inspecting Individual Audio Inputs
When working with multiple inputs where file lengths differ,
cs-status reflects the duration of the entire setup. To
view the duration and sample count of an individual file input, use:
ai-status: Displays the sample rate, channel count, duration, and sample count for the currently selected audio input.aio-status: Displays the properties and metrics for all currently assigned audio inputs and outputs at once.
Alternative
Command-Line Check: ecalength
If you need to check the duration and sample count of an audio file from the system shell without launching an interactive Ecasound session, use the standalone utility provided with Ecasound:
ecalength audiofile.wavThis outputs the length in seconds, total samples, and standard time
format (HH:MM:SS.ms).