File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,12 @@ class AudioBoard {
62
62
this ->volume = volume;
63
63
return driver->setVolume (volume);
64
64
}
65
- int getVolume () { return volume >= 0 ? volume : driver->getVolume (); }
65
+ int getVolume () {
66
+ #if DRIVER_REPORT_DRIVER_VOLUME
67
+ return driver->getVolume (); }
68
+ #else
69
+ return volume >= 0 ? volume : driver->getVolume (); }
70
+ #endif
66
71
DriverPins& getPins () { return *pins; }
67
72
bool setPAPower (bool enable) { return driver->setPAPower (enable); }
68
73
// / set volume for adc: this is only supported on some defined codecs
Original file line number Diff line number Diff line change 5
5
# define DRIVER_DEFAULT_VOLUME 70
6
6
#endif
7
7
8
+ // AudioBoard getVolume() can report the volume reported by the driver or the volume that was last
9
+ // set. When using the driver volume, there might be small rounding errors compared to
10
+ // the last defined value.
11
+ #ifndef DRIVER_REPORT_DRIVER_VOLUME
12
+ # define DRIVER_REPORT_DRIVER_VOLUME false
13
+ #endif
14
+
15
+
8
16
// To increase the max volume e.g. for ai_thinker (ES8388) 2957 or A202 -> set
9
17
// to 1 or 2 0 AUX volume is LINE level 1 you can control the AUX volume with
10
18
// setVolume()
30
38
#ifndef FORCE_WIRE_CLOSE
31
39
# define FORCE_WIRE_CLOSE false
32
40
#endif
41
+
You can’t perform that action at this time.
0 commit comments