Skip to content

Commit a8af7d9

Browse files
committed
player a2dp example add silence_on_nodata
1 parent 873b7ff commit a8af7d9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/examples-communication/a2dp/player-sdfat-a2dp/player-sdfat-a2dp.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ A2DPStream out;
2121
MP3DecoderHelix decoder;
2222
AudioPlayer player(source, out, decoder);
2323

24-
2524
void setup() {
2625
Serial.begin(115200);
2726
AudioLogger::instance().begin(Serial, AudioLogger::Warning);
2827

28+
// setup player
2929
// Setting up SPI if necessary with the right SD pins by calling
3030
// SPI.begin(PIN_AUDIO_KIT_SD_CARD_CLK, PIN_AUDIO_KIT_SD_CARD_MISO, PIN_AUDIO_KIT_SD_CARD_MOSI, PIN_AUDIO_KIT_SD_CARD_CS);
31+
player.setVolume(0.1);
32+
player.begin();
3133

3234
// setup output - We send the test signal via A2DP - so we conect to a Bluetooth Speaker
3335
auto cfg = out.defaultConfig(TX_MODE);
34-
//cfg.name = "LEXON MINO L"; // set the device here. Otherwise the next available device is used for output
36+
cfg.silence_on_nodata = true; // prevent disconnect when there is no audio data
37+
cfg.name = "LEXON MINO L"; // set the device here. Otherwise the first available device is used for output
3538
//cfg.auto_reconnect = true; // if this is use we just quickly connect to the last device ignoring cfg.name
3639
out.begin(cfg);
3740

38-
// setup player
39-
player.setVolume(0.1);
40-
player.begin();
4141

4242
}
4343

0 commit comments

Comments
 (0)