DE10-Standard
User Manual
66
www.terasic.com
January 19, 2017
Press KEY3 to start/stop audio recording (note *2)
Press KEY2 to start/stop audio playing (note *3)
Table 5-1 Slide switches usage for audio source
Slide Switches
0
– DOWN Position
1
– UP Position
SW0
Audio is from MIC-in
Audio is from Line-in
Table 5-2 Settings of switches for the sample rate of audio recorder and player
SW5
(0
– DOWN;
1- UP)
SW4
(0
– DOWN;
1-UP)
SW3
(0
– DOWN;
1-UP)
Sample Rate
0
0
0
96K
0
0
1
48K
0
1
0
44.1K
0
1
1
32K
1
0
0
8K
Unlisted combination
96K
Note:
(1). Execute DE10_Standard_Audio/demo_batch/test.bat to download .sof and .elf
files.
(2). Recording process will stop if the audio buffer is full.
(3). Playing process will stop if the audio data is played completely.
5
5
.
.
3
3
K
K
a
a
r
r
a
a
o
o
k
k
e
e
M
M
a
a
c
c
h
h
i
i
n
n
e
e
This demonstration uses the microphone-in, line-in, and line-out ports on DE10-Standard to create a
Karaoke machine. The WM8731 CODEC is configured in master mode. The audio CODEC
generates AD/DA serial bit clock (BCK) and the left/right channel clock (LRCK) automatically. The
I2C interface is used to configure the audio CODEC, as shown in
Figure 5-4
. The sample rate and
gain of the CODEC are set in a similar manner, and the data input from the line-in port is then
mixed with the microphone-in port. The result is sent out to the line-out port.
The sample rate is set to 48 kHz in this demonstration. The gain of the audio CODEC is
reconfigured via I2C bus by pressing the pushbutton KEY0, cycling within ten predefined gain
values (volume levels) provided by the device.