Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ESP32-audioI2S
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ESP32-audioI2S
Commits
b44c54cb
Unverified
Commit
b44c54cb
authored
May 15, 2021
by
Wolle
Committed by
GitHub
May 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SdFat support
parent
076234c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
examples/SdFat/SdFat_example.ino
examples/SdFat/SdFat_example.ino
+55
-0
No files found.
examples/SdFat/SdFat_example.ino
0 → 100644
View file @
b44c54cb
//**********************************************************************************************************
//* audioI2S-- I2S audiodecoder for ESP32, *
//**********************************************************************************************************
//
// first release on 05/2020
//
// SdFat example
// activate SDFATFS_USED in Audio.h
#include "Arduino.h"
#include "SdFat.h" // https://github.com/greiman/SdFat-beta
#include "Audio.h"
#include "SPI.h"
// Digital I/O used
#define SD_CS 5
#define SPI_MOSI 23
#define SPI_MISO 19
#define SPI_SCK 18
#define I2S_DOUT 25
#define I2S_BCLK 27
#define I2S_LRC 26
Audio
audio
;
void
setup
()
{
pinMode
(
SD_CS
,
OUTPUT
);
digitalWrite
(
SD_CS
,
HIGH
);
SPI
.
begin
(
SPI_SCK
,
SPI_MISO
,
SPI_MOSI
);
SPI
.
setFrequency
(
1000000
);
Serial
.
begin
(
115200
);
SD
.
begin
(
SD_CS
);
audio
.
setPinout
(
I2S_BCLK
,
I2S_LRC
,
I2S_DOUT
);
audio
.
setVolume
(
12
);
// 0...21
audio
.
connecttoFS
(
SD
,
"test.mp3"
);
// audio.connecttoFS(SD, "良い一日私の友達.mp3");
}
void
loop
()
{
audio
.
loop
();
}
// optional
void
audio_info
(
const
char
*
info
){
Serial
.
print
(
"info "
);
Serial
.
println
(
info
);
}
void
audio_id3data
(
const
char
*
info
){
//id3 metadata
Serial
.
print
(
"id3data "
);
Serial
.
println
(
info
);
}
void
audio_eof_mp3
(
const
char
*
info
){
//end of file
Serial
.
print
(
"eof_mp3 "
);
Serial
.
println
(
info
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment