ESP32 Wroom 32E A2DP sink + sound reactive Led Stripe #703
-
Hi, I am streaming audio via Bluetooth to an ESP 32 Wroom Board and via I2S to MAX98357. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 9 replies
-
Just use the functionality of the AudioTools library. |
Beta Was this translation helpful? Give feedback.
-
Hi Phil,
I hope you can give some guidance here, I used this simple example and tried numerous of ordering and assigning but as soon as I add the VolumeMeter to the MultiOutput (in any order)
the output does not give any music anymore. Commenting out the multiOut.add(vuMeter); brings the output back.
Any suggestions on what I am missing ?
Thank you, have a nice day,
Ives
#include "AudioTools.h"
#include "BluetoothA2DPSink.h"
// Define streams
AudioInfo input_stream_info(44100, 2, 16);
// Define Outputs
I2SStream I2Sout;
VolumeMeter vuMeter;
MultiOutput multiOut;
// Link BT Input - send to multiOut ?
BluetoothA2DPSink a2dp_sink(multiOut);
void setup() {
Serial.begin(115200);
delay(200);
// Set vuOutput
vuMeter.begin(input_stream_info);
// Setup I2S Output
auto cfg = I2Sout.defaultConfig();
cfg.copyFrom(input_stream_info);
cfg.pin_bck = 22;
cfg.pin_ws = 25;
cfg.pin_data = 21;
I2Sout.begin(cfg);
// Add Outputs
//multiOut.add(vuMeter);
multiOut.add(I2Sout);
multiOut.begin(input_stream_info);
// start
a2dp_sink.set_auto_reconnect(true, 100);
a2dp_sink.start("BTPlayer");
}
void loop() {
Serial.print(vuMeter.volumePercent(0));
Serial.print("\n");
Serial.print(vuMeter.volumePercent(1));
Serial.print("\n");
}
…________________________________
From: Phil Schatzmann
Sent: Wednesday, April 23, 2025 3:29 PM
To: pschatzmann/ESP32-A2DP
Cc: Subscribed
Subject: Re: [pschatzmann/ESP32-A2DP] ESP32 Wroom 32E A2DP sink + sound reactive Led Stripe (Discussion #703)
I's not audio meter but VolumeMeter<https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_volume_meter.html>!
And yes, a MultiOutput<https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_multi_output.html> sends the output to any audio sink that has been added.
—
Reply to this email directly, view it on GitHub<#703 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A2TVDDEGS4KFOV3AJCHEQCT226IURAVCNFSM6AAAAAB3WEBJSSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEOJSGMYTKNA>.
You are receiving this because you are subscribed to this thread.
|
Beta Was this translation helpful? Give feedback.
-
this is how I did it. Maybe can help you control the "strenght" of the signal, aka how many Led will lit, so you might need to change it according to your input signal #include "AudioTools.h" // ==== LED Setup ==== CRGB ledsLeft[NUM_LEDS]; // ==== Audio Setup ==== // ==== Volume Meter Class ==== virtual size_t write(const uint8_t data, size_t len) {
} void showVolumeOnLEDs(int volumeL, int volumeR) {
} CRGB getColorForVolume(int volume) { // Create instance of StereoVolumeMeter void setup() { // ==== Setup LEDs ==== // ==== Setup Audio ==== cfg.sample_rate = 44100; cfg.pin_bck = 33; // BCLK // ==== Buffer Size and Count ==== i2s.begin(cfg); multi.add(i2s); // First output: I2S DAC a2dp_sink.start("SOUNDit2"); // Bluetooth Device Name void loop() { } |
Beta Was this translation helpful? Give feedback.
-
There was indeed a bug in the VolumeMeter. I committed a correction which should resolve the issue. |
Beta Was this translation helpful? Give feedback.
-
Thank you Phil,
Confirmed - fixed.
…________________________________
From: Phil Schatzmann ***@***.***>
Sent: Tuesday, April 29, 2025 9:47 PM
To: pschatzmann/ESP32-A2DP ***@***.***>
Cc: Ives-Heymans ***@***.***>; Comment ***@***.***>
Subject: Re: [pschatzmann/ESP32-A2DP] ESP32 Wroom 32E A2DP sink + sound reactive Led Stripe (Discussion #703)
There was indeed a bug in the VolumeMeter. I committed a correction<pschatzmann/arduino-audio-tools@e8497cd> which should resolve the issue.
Don't forget to set the core debug level, so that you can see any A2DP errors or warnings....
—
Reply to this email directly, view it on GitHub<#703 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A2TVDDBVQHNSDRYGK4QKDFT237JNLAVCNFSM6AAAAAB3WEBJSSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEOJYGQ4DEOA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Just use the functionality of the AudioTools library.
Use a MultiOutput to send the output to an I2SStream and a VolumeMeter. From the latter you can pick up the volume.
Further info can be found into the Wiki...