...
This commit is contained in:
18
src/main.cpp
18
src/main.cpp
@@ -30,6 +30,8 @@ const int startDelay = 250;
|
||||
|
||||
Audio audio;
|
||||
|
||||
uint volume = 18;
|
||||
|
||||
AsyncWebServer server(80);
|
||||
DNSServer dns;
|
||||
|
||||
@@ -69,6 +71,18 @@ void audio_info(const char *info)
|
||||
// Serial.print("info "); Serial.println(info);
|
||||
}
|
||||
|
||||
void mute() {
|
||||
if (audio.getVolume()!=0) {
|
||||
volume = audio.getVolume();
|
||||
}
|
||||
|
||||
audio.setVolume(0);
|
||||
}
|
||||
|
||||
void unmute() {
|
||||
audio.setVolume(volume);
|
||||
}
|
||||
|
||||
String getState()
|
||||
{
|
||||
String state = String();
|
||||
@@ -133,7 +147,7 @@ void start()
|
||||
}
|
||||
|
||||
void next()
|
||||
{
|
||||
{
|
||||
playNextMp3();
|
||||
}
|
||||
|
||||
@@ -170,7 +184,7 @@ void setup()
|
||||
|
||||
// printDirectory(root, 0);
|
||||
audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT);
|
||||
audio.setVolume(12); // 0...21
|
||||
audio.setVolume(volume); // 0...21
|
||||
|
||||
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
|
||||
{ request->send_P(200, "text/html", index_html, processor); });
|
||||
|
||||
Reference in New Issue
Block a user