Audio Codec Breakout - WM8960 Hookup Guide

Pages
Contributors: QCPete, bboyho
Favorited Favorite 0

Example 6: 3D Enhance

In this example, we will pass a line level audio source into the WM8960's line input 1 port. The audio source will go through the mixers and gain stages into the ADC. With the loopback turned on, the ADC is sent directly to the DAC and output to the headphone output. In the loop() function, turn on and off the 3D enhance feature every 5 seconds.

Hardware Hookup

Connect power, I2C, line input 1, and the headphone output as explained earlier. Your circuit should look similar to the circuit diagram below.

alt text

Connect a USB cable into your IoT RedBoard ESP32 and a TRS cable from your audio source (e.g. MP3 player, smartphone, or computer) into the audio connector. Then connect your headphones to the output. For those that are sensitive to sounds, you may want to hear the example output before inserting the headphones into your ears.

Upload Code

From the menu, select the following: File > Examples > SparkFun WM8960 Arduino Library > Example_06_3D_Enhance. If you have not already, select your Board (in this case the SparkFun ESP32 IoT RedBoard), and associated COM port. Then hit the upload button.

Open the Arduino Serial Monitor and set it to 115200 baud to view the serial output when the 3D enhance mode is enabled. Then hit the play button on your audio source. Make sure that the volume from the audio source is turned up. Experience the virtual surround sound!