### Build and Install SpeexDSP Source: https://github.com/voice-engine/ec/wiki/Home This snippet details the steps to build and install the SpeexDSP library. It includes installing prerequisite packages like autoconf, libtool, and fftw3-dev, cloning the official repository, running the autogen script, configuring the build with FFTW3 and NEON support, compiling the code, and finally installing it system-wide. ```bash sudo apt-get install -y autoconf libtool libfftw3-dev git clone https://github.com/xiph/speexdsp.git cd speexdsp ./autogen.sh ./configure --with-fft=gpl-fftw3 --enable-neon make sudo make install ``` -------------------------------- ### Run ec with PulseAudio Source: https://github.com/voice-engine/ec/blob/master/README.md Example command to execute the 'ec' tool, specifying PulseAudio hardware devices for input and output. This assumes PulseAudio has been configured as shown previously. ```shell ./ec -i plughw:0 -o plughw:0 ``` -------------------------------- ### PulseAudio Setup for ec Source: https://github.com/voice-engine/ec/blob/master/README.md Commands to configure PulseAudio by loading specific modules for sink and source, and setting them as the default audio devices. This prepares PulseAudio to work with the 'ec' tool. ```APIDOC pacmd load-module module-pipe-sink sink_name=ec.sink format=s16 rate=16000 channels=1 file=/tmp/ec.input pacmd load-module module-pipe-source source_name=ec.source format=s16 rate=16000 channels=2 file=/tmp/ec.output pacmd set-default-sink ec.sink pacmd set-default-source ec.source ``` -------------------------------- ### Install and Configure ALSA FIFO Plugin Source: https://github.com/voice-engine/ec/blob/master/README.md Provides instructions to clone, build, and install a custom ALSA FIFO plugin. This plugin enables the use of named pipes as ALSA capture devices, facilitating integration with applications like ec. ```shell git clone https://github.com/voice-engine/alsa_plugin_fifo.git cd alsa_plugin_fifo make && sudo make install # Copy configuration to apply the plugin cp asound.conf ~/.asoundrc ``` -------------------------------- ### ec_hw Usage Example Source: https://github.com/voice-engine/ec/blob/master/README.md Demonstrates how to use 'ec_hw' by specifying input device, channel count, loopback channel, and microphone channel list. It also shows how to capture processed audio to a file. ```shell # terminal #1, run ec_hw ./ec_hw -i plughw:1 -c 8 -l 7 -m 0,1,2,3 # terminal #3, record cat /tmp/ec.output > 16k_s16le_4_channels.raw ``` -------------------------------- ### Build Voice Engine EC Project Source: https://github.com/voice-engine/ec/blob/master/README.md Installs necessary development libraries for ALSA and SpeexDSP, clones the project repository, and compiles the ec and ec_hw executables using the make build system. ```shell sudo apt-get -y install libasound2-dev libspeexdsp-dev git clone https://github.com/voice-engine/ec.git cd ec make ``` -------------------------------- ### Run ec for AEC with ALSA Devices Source: https://github.com/voice-engine/ec/blob/master/README.md Demonstrates how to execute the ec application for acoustic echo cancellation. It shows how to display help options and specifies input/output ALSA devices and channels for processing. ```shell # terminal #1, run ec ./ec -h ./ec -i plughw:1 -o plughw:1 -s ``` -------------------------------- ### ec_hw Command Line Options Source: https://github.com/voice-engine/ec/blob/master/README.md Shows the available command-line arguments for the 'ec_hw' tool, which is designed for devices with hardware audio loopback capabilities. ```shell ./ec_hw -h ``` -------------------------------- ### Data Flow for ec with Named Pipes Source: https://github.com/voice-engine/ec/blob/master/README.md Illustrates the data flow for the ec application when hardware loopback is not available. It shows how ec reads playback audio from a named pipe (`/tmp/ec.input`) and writes processed audio to another named pipe (`/tmp/ec.output`). ```shell # terminal #2, play 16k fs, 16 bits, 1 channel raw audio cat 16k_s16le_mono_audio.raw > /tmp/ec.input # terminal #3, record cat /tmp/ec.output > 16k_s16le_stereo_audio.raw ``` -------------------------------- ### ec for Raspberry Pi with ReSpeaker 2 Mic Hat Source: https://github.com/voice-engine/ec/blob/master/README.md Command to run 'ec' on a Raspberry Pi with a ReSpeaker 2 Mic Hat, accounting for a 200ms delay between playback and recording. It specifies input and output devices. ```shell ./ec -i plughw:1 -o plughw:1 -d 200 ``` -------------------------------- ### ec_hw Input Device Selection Source: https://github.com/voice-engine/ec/blob/master/README.md Command to list available audio input devices on the system, which is necessary for correctly specifying the input device name when using 'ec_hw'. ```shell arecord -L ``` -------------------------------- ### Disable PulseAudio Autospawn Source: https://github.com/voice-engine/ec/blob/master/README.md Instructions to disable PulseAudio's automatic spawning feature by modifying client configuration files. This is necessary if PulseAudio needs to be manually managed or disabled. ```APIDOC autospawn=no # Add this line to ~/.config/pulse/client.conf or /etc/pulse/client.conf # Then run: pulseaudio -k ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.