voxtas wrote: ↑Fri May 14, 2021 5:55 pm
Hello is this user "megabite" is still using this forum? I've bachelors work with the same principle as his. Trying to stream audio from phone via bluetooth to cars aux in, and I desperatly need help. Thanks.
I have just done something like that. The ESP32 has 2 DAC Converters onboard. The output is on GPIO25 and GPIO26. I have connected them directly with cinch cables to my home amplifier. Basically it should be the same for your car. Additionally to 25 and 26 of course you need GND. That is the analog part to the radio.
The bluetooth part uses the library ESP32-A2DP. you find that on github.
https://github.com/pschatzmann/ESP32-A2DP.
The sample given with the lib works for me.
#include "BluetoothA2DPSink.h"
BluetoothA2DPSink a2dp_sink;
void setup()
{
static const i2s_config_t i2s_config =
{
.mode = (i2s_mode_t) (I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN),
.sample_rate = 44100, // corrected by info from bluetooth
.bits_per_sample = (i2s_bits_per_sample_t) 16, /* the DAC module will only take the 8bits from MSB */
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
.communication_format = I2S_COMM_FORMAT_I2S_MSB,
.intr_alloc_flags = 0, // default interrupt priority
.dma_buf_count = 8,
.dma_buf_len = 64,
.use_apll = false
};
a2dp_sink.set_i2s_config(i2s_config);
a2dp_sink.start("VSX828-SAT/CBL");
}
void loop()
{
}