Skip to content

Commit ee87fbe

Browse files
committed
vs1053 player
1 parent d425917 commit ee87fbe

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

examples/examples-vs1053/player-sd-vs1053/player-sd-vs1053.ino

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @file player-sd-vs1053.ino
3-
* @brief Audio player which sends the output to a VS1053 module
3+
* @brief Audio player which sends the output to a VS1053 module. Using a module with built in SD card
44
*
55
* @author Phil Schatzmann
66
* @copyright GPLv3
@@ -13,11 +13,11 @@
1313
#include "AudioLibs/AudioSourceSdFat.h"
1414
#include "AudioCodecs/CodecCopy.h"
1515

16-
#define SD_CARD_CS 13
16+
#define SD_CARD_CS 22
1717

1818
const char *startFilePath="/";
1919
const char* ext="mp3";
20-
SdSpiConfig sdcfg(SD_CARD_CS, DEDICATED_SPI, SD_SCK_MHZ(10) , &SPI);
20+
SdSpiConfig sdcfg(SD_CARD_CS, SHARED_SPI, SD_SCK_MHZ(5) , &SPI);
2121
AudioSourceSdFat source(startFilePath, ext, sdcfg);
2222
VS1053Stream vs1053; // final output
2323
AudioPlayer player(source, vs1053, *new CopyDecoder());
@@ -27,8 +27,6 @@ void setup() {
2727
Serial.begin(115200);
2828
AudioLogger::instance().begin(Serial, AudioLogger::Info);
2929

30-
SPI.begin(SD_CARD_CS);
31-
3230
// setup output
3331
auto cfg = vs1053.defaultConfig();
3432
cfg.is_encoded_data = true; // vs1053 is accepting encoded data
@@ -38,9 +36,10 @@ void setup() {
3836
//cfg.dreq_pin = VS1053_DREQ;
3937
//cfg.reset_pin = VS1053_RESET;
4038
vs1053.begin(cfg);
39+
vs1053.setVolume(1.0); // full volume
4140

4241
// setup player
43-
player.setVolume(0.7);
42+
player.setVolume(0.7); // we use volume control of the player
4443
player.begin();
4544

4645
// select file with setPath() or setIndex()

0 commit comments

Comments
 (0)