1 /*
2 * Copyright (C) 2015-2020 Alibaba Group Holding Limited
3 */
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <stdint.h>
7 #include <string.h>
8 #include "sound_pcm.h"
9 #include "sound_mixer.h"
10 #include "ulog/ulog.h"
11
12 #define LOG_TAG "[sound_example_vol]"
13
sound_example_setvol_entry(int argc,char ** argv)14 void sound_example_setvol_entry(int argc, char **argv)
15 {
16 int volume = 0;
17 if (argc < 2) {
18 LOGE(LOG_TAG, "%s:%d: Usage: %s vaue, e.g. >> setvol 90 ", __func__, __LINE__, argv[0]);
19 return;
20 }
21 volume = atoi(argv[1]);
22 aos_set_master_volume(volume);
23 }
24
sound_example_getvol_entry(int argc,char ** argv)25 void sound_example_getvol_entry(int argc, char **argv)
26 {
27 int volume = 0;
28 aos_get_master_volume(&volume);
29 LOGD(LOG_TAG, "%s:%d: get volume %d", __func__, __LINE__, volume);
30 }