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
dfb0b8e8
Unverified
Commit
dfb0b8e8
authored
Jan 15, 2019
by
Wolle
Committed by
GitHub
Jan 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add files via upload
parent
0dbeb730
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
0 deletions
+83
-0
examples/I2Saudio.ino
examples/I2Saudio.ino
+83
-0
No files found.
examples/I2Saudio.ino
0 → 100644
View file @
dfb0b8e8
#include "Arduino.h"
#include "WiFi.h"
#include "Audio.h"
#include "SD.h"
#include "FS.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
;
String
ssid
=
"Wolles-FRITZBOX"
;
String
password
=
"*******"
;
void
setup
()
{
SPI
.
begin
(
SPI_SCK
,
SPI_MISO
,
SPI_MOSI
);
Serial
.
begin
(
115200
);
SD
.
begin
(
SD_CS
);
WiFi
.
disconnect
();
WiFi
.
mode
(
WIFI_STA
);
WiFi
.
begin
(
ssid
.
c_str
(),
password
.
c_str
());
while
(
WiFi
.
status
()
!=
WL_CONNECTED
)
delay
(
1500
);
audio
.
setPinout
(
I2S_BCLK
,
I2S_LRC
,
I2S_DOUT
);
audio
.
setVolume
(
21
);
// 0...21
//audio.connecttoSD("/320k_test.mp3");
//audio.connecttohost("www.wdr.de/wdrlive/media/einslive.m3u");
audio
.
connecttohost
(
"dg-ais-eco-http-fra-eco-cdn.cast.addradio.de/hellwegradio/west/mp3/high"
);
//audio.connecttohost("fischkopp.stream.laut.fm/fischkopp");
//audio.connecttospeech("Wenn die Hunde schlafen, kann der Wolf gut Schafe stehlen.", "de");
}
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
);
}
void
audio_showstation
(
const
char
*
info
){
Serial
.
print
(
"station "
);
Serial
.
println
(
info
);
}
void
audio_showstreaminfo
(
const
char
*
info
){
Serial
.
print
(
"streaminfo "
);
Serial
.
println
(
info
);
}
void
audio_showstreamtitle
(
const
char
*
info
){
Serial
.
print
(
"streamtitle "
);
Serial
.
println
(
info
);
}
void
audio_bitrate
(
const
char
*
info
){
Serial
.
print
(
"bitrate "
);
Serial
.
println
(
info
);
}
void
audio_commercial
(
const
char
*
info
){
//duration in sec
Serial
.
print
(
"commercial "
);
Serial
.
println
(
info
);
}
void
audio_icyurl
(
const
char
*
info
){
//homepage
Serial
.
print
(
"icyurl "
);
Serial
.
println
(
info
);
}
void
audio_lasthost
(
const
char
*
info
){
//stream URL played
Serial
.
print
(
"lasthost "
);
Serial
.
println
(
info
);
}
void
audio_eof_speech
(
const
char
*
info
){
Serial
.
print
(
"eof_speech "
);
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