Hello,
I need to mix two I2S inputs into one output, but I am failing to get just one input through the teensy to the output.
I have an ESP32, which functions as a bluetooth receiver:
For now I was just focusing on getting this audio into the teensy (as a passthrough) and out to a MAX98357A which than goes into the speaker. Later one, I want to add a microphone Input and mix it with the input from the music (to create ANC)
I connected everything like this:
ESP -> Teensy
Gio 16 (BCLK) -> 21
Gio 17 (LRCLK) -> 20
Gio 18 (Data) -> 13
Gnd -> Gnd
Teensy -> MAX98357A
2 -> LRCLK
3 -> VIN
4 -> BCLK
gnd -> gnd
5 -> v1n
And this is my Teensy Code:
My result is that there is no music playing... I can confirm that the esp is receiving data from the smartphone and at least trying to send it and whenever it sends, an orange LED is turned on on the Teensy. The Speakers are making a steady background noice, which does not change when I start and stop the music on the smartphone.
I tested the Sound output manually with a test sketch, so we can assume that the speakers and the MAX98357A are working. I also tested if the ESP32 is sending something with LEDs, which it does, so it is either a problem between the communication of ESP and Teensy, or it is a problem with the passing through part.
Does anyone have an idea why this would not work?
Thanks in advance
I need to mix two I2S inputs into one output, but I am failing to get just one input through the teensy to the output.
I have an ESP32, which functions as a bluetooth receiver:
Code:
#include "AudioTools.h"
#include "BluetoothA2DPSink.h"
I2SStream i2s;
BluetoothA2DPSink a2dp_sink(i2s);
void setup() {
Serial.begin(115200);
auto cfg = i2s.defaultConfig();
cfg.pin_bck = 16;
cfg.pin_ws = 17;
cfg.pin_data = 18;
cfg.sample_rate = 44100;
cfg.bits_per_sample = 16;
cfg.channels = 2;
cfg.i2s_format = I2S_PHILIPS_FORMAT;
i2s.begin(cfg);
a2dp_sink.set_auto_reconnect(true);
a2dp_sink.start("ESP32-Teensy");
}
void loop() {
}
For now I was just focusing on getting this audio into the teensy (as a passthrough) and out to a MAX98357A which than goes into the speaker. Later one, I want to add a microphone Input and mix it with the input from the music (to create ANC)
I connected everything like this:
ESP -> Teensy
Gio 16 (BCLK) -> 21
Gio 17 (LRCLK) -> 20
Gio 18 (Data) -> 13
Gnd -> Gnd
Teensy -> MAX98357A
2 -> LRCLK
3 -> VIN
4 -> BCLK
gnd -> gnd
5 -> v1n
And this is my Teensy Code:
Code:
#include <Audio.h>
// Audio-Objekte
AudioInputI2S i2s1_in; // Input from ESP32
AudioOutputI2S2 i2s2_out; // Output to MAX98357A
AudioConnection patchCord1(i2s1_in, 0, i2s2_out, 0);
AudioConnection patchCord2(i2s1_in, 1, i2s2_out, 1);
void setup() {
AudioMemory(12);
Serial.begin(115200);
delay(500);
Serial.println("Teensy I2S debug start");
}
void loop() {
}
My result is that there is no music playing... I can confirm that the esp is receiving data from the smartphone and at least trying to send it and whenever it sends, an orange LED is turned on on the Teensy. The Speakers are making a steady background noice, which does not change when I start and stop the music on the smartphone.
I tested the Sound output manually with a test sketch, so we can assume that the speakers and the MAX98357A are working. I also tested if the ESP32 is sending something with LEDs, which it does, so it is either a problem between the communication of ESP and Teensy, or it is a problem with the passing through part.
Does anyone have an idea why this would not work?
Thanks in advance
Last edited: