Skip to content

Commit cb8c00f

Browse files
committed
feature-files
1 parent 987de48 commit cb8c00f

File tree

32 files changed

+1625
-349
lines changed

32 files changed

+1625
-349
lines changed

examples/examples-audiokit/player-sd-audiokit/player-sd-audiokit.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010
#include "AudioTools.h"
1111
#include "AudioLibs/AudioKit.h"
12-
#include "AudioLibs/AudioSourceSd.h"
12+
#include "AudioLibs/AudioSourceSD.h"
1313
#include "AudioCodecs/CodecMP3Helix.h"
1414

1515
const char *startFilePath="/";
1616
const char* ext="mp3";
17-
AudioSourceSd source(startFilePath, ext, PIN_AUDIO_KIT_SD_CARD_CS);
17+
AudioSourceSD source(startFilePath, ext, PIN_AUDIO_KIT_SD_CARD_CS);
1818
AudioKitStream kit;
1919
MP3DecoderHelix decoder; // or change to MP3DecoderMAD
2020
AudioPlayer player(source, kit, decoder);

examples/examples-audiokit/player-sd_a2dp-audiokit/player-sd_a2dp-audiokit.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
#include "AudioTools.h"
1515
#include "AudioLibs/AudioA2DP.h"
1616
#include "AudioLibs/AudioKit.h"
17-
#include "AudioLibs/AudioSourceSdFat.h"
17+
#include "AudioLibs/AudioSourceSDFAT.h"
1818
#include "AudioCodecs/CodecMP3Helix.h"
1919

2020
const char *startFilePath="/";
2121
const char* ext="mp3";
2222
AudioKitStream kit;
2323
SdSpiConfig sdcfg(PIN_AUDIO_KIT_SD_CARD_CS, DEDICATED_SPI, SD_SCK_MHZ(10) , &AUDIOKIT_SD_SPI);
24-
AudioSourceSdFat source(startFilePath, ext, sdcfg);
24+
AudioSourceSDFAT source(startFilePath, ext, sdcfg);
2525
MP3DecoderHelix decoder;
2626
AudioPlayer player(source, kit, decoder);
2727
BluetoothA2DPSink a2dp_sink;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Using the AI Thinker ESP32 Audio Kit as SD Player
2+
3+
I found some cheap [AI Thinker ESP32 Audio Kit V2.2](https://docs.ai-thinker.com/en/esp32-audio-kit) on AliExpress and because I was tired of all the wires I had to connect to implement my different scenarios that are possible with my [Arduino Audio Tools Library](https://github.com/pschatzmann/arduino-audio-tools), I thought it to be a good idea to buy this board.
4+
5+
<img src="https://pschatzmann.github.io/arduino-audio-tools/resources/audio-toolkit.png" alt="Audio Kit" />
6+
7+
You dont need to bother about any wires because everything is on one nice board. Just just need to install the dependencies
8+
To access the files we use the SD library.
9+
10+
This example is using the indexed version which creates an index file on the sd.
11+
12+
### Note
13+
14+
The log level has been set to Info to help you to identify any problems. Please change it to AudioLogger::Warning to get the best sound quality!
15+
16+
17+
## Dependencies
18+
19+
You need to install the following libraries:
20+
21+
- https://github.com/pschatzmann/arduino-audio-tools
22+
- https://github.com/pschatzmann/arduino-libhelix
23+
- https://github.com/pschatzmann/arduino-audiokit
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* @file player-sd-audiokit.ino
3+
* @brief see https://github.com/pschatzmann/arduino-audio-tools/blob/main/examples/examples-audiokit/player-sd-audiokit/README.md
4+
* Make sure that the pins are set to off, on, on, off, off
5+
* @author Phil Schatzmann
6+
* @copyright GPLv3
7+
*/
8+
9+
10+
#include "AudioTools.h"
11+
#include "AudioLibs/AudioKit.h"
12+
#include "AudioLibs/AudioSourceIdxSD.h"
13+
#include "AudioCodecs/CodecMP3Helix.h"
14+
15+
const char *startFilePath="/";
16+
const char* ext="mp3";
17+
AudioSourceSD source(startFilePath, ext, PIN_AUDIO_KIT_SD_CARD_CS);
18+
AudioKitStream kit;
19+
MP3DecoderHelix decoder; // or change to MP3DecoderMAD
20+
AudioPlayer player(source, kit, decoder);
21+
22+
void setup() {
23+
Serial.begin(115200);
24+
AudioLogger::instance().begin(Serial, AudioLogger::Info);
25+
26+
// setup output
27+
auto cfg = kit.defaultConfig(TX_MODE);
28+
// sd_active is setting up SPI with the right SD pins by calling
29+
// 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);
30+
cfg.sd_active = true;
31+
kit.begin(cfg);
32+
33+
34+
// setup player
35+
player.setVolume(0.7);
36+
player.begin();
37+
38+
// select file with setPath() or setIndex()
39+
//player.setPath("/ZZ Top/Unknown Album/Lowrider.mp3");
40+
//player.setIndex(1); // 2nd file
41+
42+
}
43+
44+
void loop() {
45+
player.copy();
46+
}

examples/examples-audiokit/player-sdfat-audiokit/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ You need to install the following libraries:
1818

1919
- https://github.com/pschatzmann/arduino-audio-tools
2020
- https://github.com/pschatzmann/arduino-libhelix
21-
- https://github.com/greiman/SdFat
2221
- https://github.com/pschatzmann/arduino-audiokit
22+
- https://github.com/greiman/SdFat

examples/examples-audiokit/player-sdfat-audiokit/player-sdfat-audiokit.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99

1010
#include "AudioTools.h"
1111
#include "AudioLibs/AudioKit.h"
12-
#include "AudioLibs/AudioSourceSdFat.h"
12+
#include "AudioLibs/AudioSourceSDFAT.h"
1313
#include "AudioCodecs/CodecMP3Helix.h"
1414

1515
const char *startFilePath="/";
1616
const char* ext="mp3";
1717
SdSpiConfig sdcfg(PIN_AUDIO_KIT_SD_CARD_CS, DEDICATED_SPI, SD_SCK_MHZ(10) , &AUDIOKIT_SD_SPI);
18-
AudioSourceSdFat source(startFilePath, ext, sdcfg);
18+
AudioSourceSDFAT source(startFilePath, ext, sdcfg);
1919
AudioKitStream kit;
2020
MP3DecoderHelix decoder; // or change to MP3DecoderMAD
2121
AudioPlayer player(source, kit, decoder);
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Using the AI Thinker ESP32 Audio Kit as SD Player
2+
3+
I found some cheap [AI Thinker ESP32 Audio Kit V2.2](https://docs.ai-thinker.com/en/esp32-audio-kit) on AliExpress and because I was tired of all the wires I had to connect to implement my different scenarios that are possible with my [Arduino Audio Tools Library](https://github.com/pschatzmann/arduino-audio-tools), I thought it to be a good idea to buy this board.
4+
5+
<img src="https://pschatzmann.github.io/arduino-audio-tools/resources/audio-toolkit.png" alt="Audio Kit" />
6+
7+
You dont need to bother about any wires because everything is on one nice board. Just just need to install the dependencies
8+
To access the files we use the greiman/SdFat library.
9+
10+
This example is using the indexed version which creates an index file on the sd.
11+
12+
### Note
13+
14+
The log level has been set to Info to help you to identify any problems. Please change it to AudioLogger::Warning to get the best sound quality!
15+
16+
17+
## Dependencies
18+
19+
You need to install the following libraries:
20+
21+
- https://github.com/pschatzmann/arduino-audio-tools
22+
- https://github.com/pschatzmann/arduino-libhelix
23+
- https://github.com/pschatzmann/arduino-audiokit
24+
- https://github.com/greiman/SdFat
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/**
2+
* @file player-sd-audiokit.ino
3+
* @brief see https://github.com/pschatzmann/arduino-audio-tools/blob/main/examples/examples-audiokit/player-sdfat-audiokit/README.md
4+
* Make sure that the pins are set to off, on, on, off, off
5+
* @author Phil Schatzmann
6+
* @copyright GPLv3
7+
*/
8+
9+
10+
#include "AudioTools.h"
11+
#include "AudioLibs/AudioKit.h"
12+
#include "AudioLibs/AudioSourceIdxSDFAT.h"
13+
#include "AudioCodecs/CodecMP3Helix.h"
14+
15+
const char *startFilePath="/";
16+
const char* ext="mp3";
17+
SdSpiConfig sdcfg(PIN_AUDIO_KIT_SD_CARD_CS, DEDICATED_SPI, SD_SCK_MHZ(10) , &AUDIOKIT_SD_SPI);
18+
AudioSourceSDFAT source(startFilePath, ext, sdcfg);
19+
AudioKitStream kit;
20+
MP3DecoderHelix decoder; // or change to MP3DecoderMAD
21+
AudioPlayer player(source, kit, decoder);
22+
23+
void next(bool, int, void*) {
24+
player.next();
25+
}
26+
27+
void previous(bool, int, void*) {
28+
player.previous();
29+
}
30+
31+
void setup() {
32+
Serial.begin(115200);
33+
AudioLogger::instance().begin(Serial, AudioLogger::Info);
34+
35+
// setup output
36+
auto cfg = kit.defaultConfig(TX_MODE);
37+
kit.begin(cfg);
38+
39+
// setup additional buttons
40+
kit.addAction(PIN_KEY4, next);
41+
kit.addAction(PIN_KEY3, previous);
42+
43+
44+
// setup player
45+
player.setVolume(0.7);
46+
player.begin();
47+
48+
// select file with setPath() or setIndex()
49+
//player.setPath("/ZZ Top/Unknown Album/Lowrider.mp3");
50+
//player.setIndex(1); // 2nd file
51+
52+
}
53+
54+
void loop() {
55+
player.copy();
56+
kit.processActions();
57+
}

examples/examples-audiokit/player-sdmmc-audiokit/player-sdmmc-audiokit.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
#include "AudioTools.h"
1010
#include "AudioLibs/AudioKit.h"
11-
#include "AudioLibs/AudioSourceSdMmc.h"
11+
#include "AudioLibs/AudioSourceSDMMC.h"
1212
#include "AudioCodecs/CodecMP3Helix.h"
1313

1414
const char *startFilePath="/";
1515
const char* ext="mp3";
16-
AudioSourceSdMmc source(startFilePath, ext);
16+
AudioSourceSDMMC source(startFilePath, ext);
1717
AudioKitStream kit;
1818
MP3DecoderHelix decoder; // or change to MP3DecoderMAD
1919
AudioPlayer player(source, kit, decoder);
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Using the AI Thinker ESP32 Audio Kit as SD Player
2+
3+
I found some cheap [AI Thinker ESP32 Audio Kit V2.2](https://docs.ai-thinker.com/en/esp32-audio-kit) on AliExpress and because I was tired of all the wires I had to connect to implement my different scenarios that are possible with my [Arduino Audio Tools Library](https://github.com/pschatzmann/arduino-audio-tools), I thought it to be a good idea to buy this board.
4+
5+
<img src="https://pschatzmann.github.io/arduino-audio-tools/resources/audio-toolkit.png" alt="Audio Kit" />
6+
7+
You dont need to bother about any wires because everything is on one nice board. Just just need to install the dependencies
8+
9+
In this example we use the SDMMC library which is provided by the ESP32. On the Audiokit all the pins must be on the on position!
10+
11+
This example is using the indexed version which creates an index file on the sd.
12+
13+
### Note
14+
15+
The log level has been set to Info to help you to identify any problems. Please change it to AudioLogger::Warning to get the best sound quality!
16+
17+
18+
## Dependencies
19+
20+
You need to install the following libraries:
21+
22+
- https://github.com/pschatzmann/arduino-audio-tools
23+
- https://github.com/pschatzmann/arduino-libhelix
24+
- https://github.com/pschatzmann/arduino-audiokit

0 commit comments

Comments
 (0)