Example Code for Mango-Pi-Audio Record Play

This article serves as a guide on setting up the Mango-Pi board for audio recording and playback, offering step-by-step instructions and example codes to configure the system, modify settings, and execute audio tasks effectively.

Requirements

  • Mango-Pi board with firmware burned ×1
  • Serial port to network port installation driver
  • Speaker ×1

62

Connect a speaker to the port OUT+ and OUT-.

Modify the configuration file

63

How to modify?

Modify command: tinymix set serial Number Content

For Example: tinymix set 2 1 Modify the value of the term which the serial number is 2 to on.

64

Modify it like this

Number of controls: 25
ctl     type    num     name                                    value
0       INT     1       DAC Playback Volume                     63 (range 0->63)
1       INT     1       Headphone Playback Volume               63 (range 0->63)
2       BOOL    2       Headphone Playback Switch               On, On
3       INT     1       Line In Playback Volume                 0 (range 0->7)
4       INT     1       FM In Playback Volume                   0 (range 0->7)
5       INT     1       Mic In Playback Volume                  3 (range 0->7)
6       INT     1       Mic Boost Volume                        4 (range 0->7)
7       INT     1       ADC Capture Volume                      3 (range 0->7)
8       BOOL    1       ADC Mixer Right Out Capture Switch      Off
9       BOOL    1       ADC Mixer Left Out Capture Switch       Off
10      BOOL    1       ADC Mixer Line In Capture Switch        Off
11      BOOL    1       ADC Mixer Right FM In Capture Switch    Off
12      BOOL    1       ADC Mixer Left FM In Capture Switch     Off
13      BOOL    1       ADC Mixer Mic Capture Switch            On
14      BOOL    1       Left Mixer Right DAC Playback Switch    Off
15      BOOL    1       Left Mixer Left DAC Playback Switch     Off
16      BOOL    1       Left Mixer FM In Playback Switch        Off
17      BOOL    1       Left Mixer Line In Playback Switch      Off
18      BOOL    1       Left Mixer Mic In Playback Switch       Off
19      BOOL    1       Right Mixer Left DAC Playback Switch    Off
20      BOOL    1       Right Mixer Right DAC Playback Switch   Off
21      BOOL    1       Right Mixer FM In Playback Switch       Off
22      BOOL    1       Right Mixer Line In Playback Switch     Off
23      BOOL    1       Right Mixer Mic In Playback Switch      Off
24      ENUM    2       Headphone Source Playback Route         , DACMixer, , DACMixer

Start Playing Audio

tinplay 001.wav

65

Start Recording

tinycap 1.wav -d 0 -c 1 -r 44100 -b 16

Press Ctrl + C to end recording.

66

Check the recording result

tinplay 1.wav

67

Was this article helpful?

TOP