Ecasound Audio Format Command-Line Syntax

This article provides a guide to the command-line syntax used to define audio format parameters in Ecasound. It covers the structure of the audio format flag, explains each comma-separated argument, and demonstrates how to apply these parameters to audio inputs and outputs.

In Ecasound, the audio format is defined using the -f option. This option specifies how raw audio samples are interpreted or how processed streams should be formatted before being sent to an output target.

The Format Syntax

The general syntax for the audio format parameter is:

-f:sample_format,channels,sample_rate[,interleaving]

The parameter requires three primary arguments separated by commas, with an optional fourth argument for interleaving:

Application and Placement

The -f option affects the audio target that follows it in the command sequence. If specified before an input (-i), it defines the incoming stream format, which is required when reading raw, headerless PCM files. If placed before an output (-o), it sets the target encoding format for that specific destination.

Examples

To record a 16-bit, 44.1 kHz stereo stream from the default ALSA device and save it to a raw PCM file:

ecasound -f:s16_le,2,44100 -i alsa -o output.raw

To read a raw 32-bit float, 48 kHz mono file and convert it into a standard WAV file:

ecasound -f:f32_le,1,48000 -i raw_track.pcm -o converted.wav