Guest User

bluetoothspeaker

a guest
Nov 25th, 2023
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | Source Code | 0 0
  1. #include "BluetoothA2DPSink.h"
  2. #include "arduinoFFT.h"
  3. #include "FastLED.h"
  4.  
  5. BluetoothA2DPSink a2dp_sink;
  6.  
  7. void setup() {
  8. static const i2s_config_t i2s_config = {
  9. .mode = (i2s_mode_t) (I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN),
  10. .sample_rate = 44100, // corrected by info from bluetooth
  11. .bits_per_sample = (i2s_bits_per_sample_t) 16, /* the DAC module will only take the 8bits from MSB */
  12. .channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
  13. .communication_format = (i2s_comm_format_t)I2S_COMM_FORMAT_STAND_MSB,
  14. .intr_alloc_flags = 0, // default interrupt priority
  15. .dma_buf_count = 8,
  16. .dma_buf_len = 64,
  17. .use_apll = false
  18. };
  19.  
  20. a2dp_sink.set_i2s_config(i2s_config);
  21. a2dp_sink.start("MyMusic");
  22.  
  23. }
  24.  
  25. void loop() {
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment