1 /*
2 * Copyright (C) 2015-2021 Alibaba Group Holding Limited
3 */
4
5 #if AOS_COMP_CLI
6 #include "aos/cli.h"
7 #endif
8
9 extern int audio_install_codec_driver();
10 extern void sound_example_wav_entry(int argc, char **argv);
11 extern void sound_example_loopback_entry(int argc, char **argv);
12 void sound_example_setvol_entry(int argc, char **argv);
13 void sound_example_getvol_entry(int argc, char **argv);
14
sound_example_install_driver(int argc,char ** argv)15 static void sound_example_install_driver(int argc, char **argv)
16 {
17 printf("sound install driver test begin ...\r\n");
18 audio_install_codec_driver();
19 printf("sound install driver test end !!!\r\n");
20 return;
21 }
22
sound_example_wav(int argc,char ** argv)23 static void sound_example_wav(int argc, char **argv)
24 {
25 printf("sound wav player test begin ...\r\n");
26 sound_example_wav_entry(argc, argv);
27 printf("sound wav player test end !!!\r\n");
28 return;
29 }
30
sound_example_loopback(int argc,char ** argv)31 static void sound_example_loopback(int argc, char **argv)
32 {
33 sound_example_loopback_entry(argc, argv);
34 return;
35 }
36
sound_example_setvol(int argc,char ** argv)37 static void sound_example_setvol(int argc, char **argv)
38 {
39 printf("sound setvol test begin ...\r\n");
40 sound_example_setvol_entry(argc, argv);
41 printf("sound setvol test end !!!\r\n");
42 return;
43 }
44
sound_example_getvol(int argc,char ** argv)45 static void sound_example_getvol(int argc, char **argv)
46 {
47 printf("sound getvol test begin ...\r\n");
48 sound_example_getvol_entry(argc, argv);
49 printf("sound getvol test end !!!\r\n");
50 return;
51 }
52
53 #if AOS_COMP_CLI
54 /* reg args: fun, cmd, description*/
55 ALIOS_CLI_CMD_REGISTER(sound_example_install_driver, sound_install_driver, sound install driver test example)
56 ALIOS_CLI_CMD_REGISTER(sound_example_wav, sound_wav, sound wav player test example)
57 ALIOS_CLI_CMD_REGISTER(sound_example_loopback, sound_loopback, sound loopback test example)
58 ALIOS_CLI_CMD_REGISTER(sound_example_setvol, sound_setvol, sound set volume test example)
59 ALIOS_CLI_CMD_REGISTER(sound_example_getvol, sound_getvol, sound get volume test example)
60 #endif
61