How to Toggle Looping in Ecasound Interactive Mode

This article provides a direct guide on how to toggle looping for audio selections within Ecasound’s Interactive Mode (IAM). Ecasound is a versatile command-line multitrack audio processor, and its interactive mode allows real-time manipulation of audio setups, playback boundaries, and transport behavior. Below, you will learn the exact interactive commands required to enable, toggle, and inspect the loop status of your active audio chainsetup.

Entering Ecasound Interactive Mode

To interactively manage audio playback, launch Ecasound with the interactive mode flag -c:

ecasound -c -i input.wav -o alsa

Once loaded, you will be placed into the Ecasound interactive prompt (ecasound ('h' for help) >).

Toggling the Loop Status

To toggle playback looping of your audio or defined selection on and off, use the cs-toggle-loop command:

cs-toggle-loop

Each time you enter cs-toggle-loop, Ecasound flips the loop state between enabled and disabled for the currently active chainsetup (cs). When enabled, playback automatically jumps back to the start position upon reaching the end of the chainsetup or selection.

Explicitly Setting and Checking Loop States

If you prefer to explicitly enable or disable looping rather than toggling it, use cs-set-loop:

To verify whether looping is currently active, query the engine using:

cs-get-loop

This returns the current boolean state (1 for active, 0 for inactive).

Defining an Audio Selection to Loop

If you want to loop a specific section of the audio rather than the entire track, define the playback boundaries before enabling playback:

  1. Set the start position (in seconds):
    setpos 10.0
  2. Set the total length of the selection (in seconds):
    cs-set-length 5.0
  3. Toggle looping on:
    cs-toggle-loop
  4. Start playback:
    start

Ecasound will play the 5-second segment starting at the 10-second mark repeatedly until you issue the stop command or disable looping with cs-toggle-loop.