6.9. Audio V2 Speaker
6.9.1. Overview
This example project shows USB Audio V2 speaker device.
PC sees a CherryUSB speaker via Device Manager
6.9.2. Project Configuration
The audio output device is auto-detected when
app.yamldeclares aboard_audio_codecdependency and the board declares bothboard_audio_codecand aboard_codec_*feature. Otherwise DAO is used.To override the auto-detection, set
CONFIG_CODECbeforefind_packageinCMakeLists.txt:set(CONFIG_CODEC 1)— force Codec outputset(CONFIG_CODEC 0)— force DAO output
The Audio Codec type is automatically matched with the hardware based on the board feature (e.g.,
board_codec_es8389). To specify an audio codec type manually, set the following inCMakeLists.txt:set(CONFIG_CODEC_NAME "wm8960").The USB High Speed and Full Speed service intervals are configured by
EP_INTERVAL_HSandEP_INTERVAL_FS. The packets-per-second value and USB maximum packet size are derived automatically from the configured interval.
6.9.3. Board Setting
Connect a USB port on PC to the PWR DEBUG port on the development board with a USB Type-C cable
Connect a USB port on PC to one of USB port on the development board with a USB Type-C cable
Connect headphone to headphone interface (Audio Codec is the default playback device), or connect speaker to DAO interface if DAO is configured.
6.9.4. Running the example
Download the program and run. The computer can automatically recognize and install the USB audio driver and enumerate a device with a speaker device.
Select the speaker device as the default player, and the PC will play audio through the headphone (Codec) interface or DAO interface depending on the configuration.