Ecasound is a software package designed for multitrack audio processing. It can be used for simple tasks like audio playback, recording and format conversions, as well as for multitrack effect processing, mixing, recording and signal recycling. Ecasound supports a wide range of audio inputs, outputs and effect algorithms. Effects and audio objects can be combined in various ways, and their parameters can be controlled by operator objects like oscillators and MIDI-CCs. Ecasound comes with many built-in effects, but does also include the ability to load and use LADSPA effect plugins.
One of the powerful features of Ecasound is the Ecasound Control Interface, ECI for short. It allows for easy remote control of Ecasound either via NetECI, or in general, allows for easy parsing of Ecasound return values if in ECI mode. This opened the road for an in my humble opinion fairly good and robust Emacs support for ecasound.
ecasound.el provides a new major mode for interacting with ecasound processes, derived from the commonly known comint-mode. Additionally, ecasound.el also provides Lisp bindings to ECI. This basically means that after initialising a ECI handler, you can call ECI functions from Emacs Lisp and work with the return values of ecasound as if they were normal Lisp values.
Following is a small example of how to use the Ecasound Control Interface from Emacs Lisp. This function is included in the ecasound.el file itself, and is reproduced here since it is a small and self contained example:
(defun ecasound-normalize (filename)
"Normalize an audio file using ECI."
(interactive "fFile to normalize: ")
(let ((tmpfile (eci-make-temp-file-name ".wav")))
(unwind-protect
(with-current-buffer (eci-init)
(eci-cs-add "analyze") (eci-c-add "1")
(eci-ai-add filename) (eci-ao-add tmpfile)
(eci-cop-add "-ev")
(message "Analyzing sample data...")
(eci-cs-connect) (eci-run)
(eci-cop-select 1) (eci-copp-select 2)
(let ((gainfactor (eci-copp-get)))
(eci-cs-disconnect)
(if (<= gainfactor 1)
(message "File already normalized!")
(eci-cs-add "apply") (eci-c-add "1")
(eci-ai-add tmpfile) (eci-ao-add filename)
(eci-cop-add "-ea:100")
(eci-cop-set 1 1 (* gainfactor 100))
(eci-cs-connect)
(eci-run)
(eci-cs-disconnect)
(message "Done"))))
(if (file-exists-p tmpfile)
(delete-file tmpfile)))))
An additional example might be the function ecasound-signalview, also included with ecasound.el.