mirror of
https://github.com/pschatzmann/ESP32-A2DP.git
synced 2024-09-21 02:27:32 +00:00
10
Volume Control
Phil Schatzmann edited this page 2021-11-06 11:05:58 +01:00
The BluetoothA2DPSink and the BluetoothA2DPSource class provide the possibility to set the volume by calling the set_volume method. This is also used for adjusting the volume via AVRC.
We provide different implementations of the VolumeControl which have different properties:
You can select an alternative implementation the following way:
#include "BluetoothA2DPSin.h"
BluetoothA2DPSink32 a2dp_sink;
SimpleExponentialVolumeControl vc;
void setup() {
a2dp_sink.set_volume_control(&vc);
a2dp_sink.start("BTExpVolume");
}
void loop() {
}
If you already have an Audio Pot, I suggest to use the LinearVolumeControl.
Not happy with the provided volume profiles ? Do you want to build a left and right balance control? You can easily provide your own implementation by just subclassing the VolumeControl class!