1.. zephyr:code-sample:: i2s-echo 2 :name: I2S echo 3 :relevant-api: i2s_interface 4 5 Process an audio stream to add an echo effect. 6 7Overview 8******** 9 10This sample demonstrates how to use an I2S driver in a simple processing of 11an audio stream. It configures and starts both the RX and TX streams and then 12mixes the original signal with its delayed form that is buffered, providing 13a simple echo effect. 14 15Requirements 16************ 17 18The sample uses the WM8731 audio CODEC that can be found, for example, 19on the Audio Codec Shield, but it can be easily adapted to use other 20CODECs. The I2S device to be used by the sample is specified by defining 21a devicetree node label named ``i2s_rxtx`` or separate node labels ``i2s_rx`` 22and ``i2s_tx`` if separate I2S devices are to be used for the RX and TX 23streams. 24 25This sample has been tested on :ref:`nrf52840dk_nrf52840` (nrf52840dk_nrf52840) 26and :ref:`nrf5340dk_nrf5340` (nrf5340dk_nrf5340_cpuapp), using the Audio Codec 27Shield, and provides overlay files for both of these boards. 28 29More information about the used shield and the CODEC itself can be found here: 30 31- `Audio Codec Shield`_ 32- `WM8731`_ 33 34Building and Running 35******************** 36 37The code can be found in :zephyr_file:`samples/drivers/i2s/echo`. 38 39To build and flash the application: 40 41.. zephyr-app-commands:: 42 :zephyr-app: samples/drivers/i2s/echo 43 :board: nrf52840dk_nrf52840 44 :goals: build flash 45 :compact: 46 47Press Button 1 to toggle the echo effect and Button 2 to stop the streams. 48 49.. _Audio Codec Shield: http://wiki.openmusiclabs.com/wiki/AudioCodecShield 50.. _WM8731: https://www.cirrus.com/products/wm8731/ 51