SD Card MP3 Player In A Dozen Lines
Автор: Darrens Bench
Загружено: 2025-12-20
Просмотров: 403
Описание:
SD Card MP3 Player In A Dozen Lines
Build an SD card MP3 player with an ESP32 using surprisingly little code! 🎵
In this video, you’ll see how to play MP3 files directly from an SD card using the ESP8266 audio library, PDM audio output, and a simple amplifier circuit. We walk through the essential wiring, SPI setup, and core code needed to get audio playing—plus tips on SD card modules, voltage requirements, and expansion ideas like LCD displays and controls.
Perfect for ESP32 beginners, Arduino enthusiasts, and DIY audio projects, this video shows how easy it is to get started and inspires you to take it further with menus, volume control, and file browsing.
🔧 Topics covered: ESP8266/ESP32 MP3 player, SD card audio playback, PDM audio, SPI wiring, DIY electronics, embedded audio projects.
#electronicsprojects #ESP32 #3D Printing #arduino
Code:
Please Note: Youtube does not permit the use of angle brackets( the two keys between "M" and "/" ) due to the risk of HTML injection. I have used "*(*" and "*)*" as a crude way of indicating these. You will need to find and replace these before the code will compile.
#include (*SD.h*)
#include "AudioFileSourceSD.h"
#include "AudioGeneratorMP3.h"
#include "AudioOutputI2S.h"
AudioFileSourceSD *file;
AudioOutputI2S *out = new AudioOutputI2S(0,AudioOutputI2S::INTERNAL_PDM);
AudioGeneratorMP3 *mp3 = new AudioGeneratorMP3();
void setup() {
SPI.begin(18/*SCLK*/,19/*MISO*/,23/*MOSI*/,5/*CS*/);
SD.begin(5/*CS*/);
file = new AudioFileSourceSD("/PutFilenameHere.mp3");
mp3-*)*begin(file, out);
}
void loop() {
if (mp3-*)*isRunning() && !mp3-*)*loop())
mp3-*)*stop();
}
Chapters:
0:23 Downloading the ESP8266Audio Library
0:31 The PDM output Filtering circuit
0:54 The Arduino Code
1:55 Warning about voltage / level conversions
2:58 General suggestions
3:15 Test setup on Breadboard
3:42 So, can it be created in just a dozen lines
4:00 Outro
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: