The latest development version of this page may be more current than this released 4.0.0 version.

I2S echo

Browse source code on GitHub

Overview

This sample demonstrates how to use an I2S driver in a simple processing of an audio stream. It configures and starts both the RX and TX streams and then mixes the original signal with its delayed form that is buffered, providing a simple echo effect.

Requirements

The sample uses the WM8731 audio CODEC that can be found, for example, on the Audio Codec Shield, but it can be easily adapted to use other CODECs. The I2S device to be used by the sample is specified by defining a devicetree node label named i2s_rxtx or separate node labels i2s_rx and i2s_tx if separate I2S devices are to be used for the RX and TX streams.

This sample has been tested on nRF52840 DK (nrf52840dk/nrf52840) and nRF5340 DK (nrf5340dk/nrf5340/cpuapp), using the Audio Codec Shield, and provides overlay files for both of these boards.

More information about the used shield and the CODEC itself can be found here:

Building and Running

The code can be found in samples/drivers/i2s/echo.

To build and flash the application:

west build -b nrf52840dk/nrf52840 samples/drivers/i2s/echo
west flash

Press Button 1 to toggle the echo effect and Button 2 to stop the streams.

See also

I2S Interface