E-Speaker Using ESP32
Introduction
The E-Speaker is a smart, portable, and versatile audio system built using the ESP32 microcontroller. Leveraging the ESP32’s Wi-Fi and Bluetooth capabilities, this project creates an affordable and efficient smart speaker capable of streaming music, playing audio files, and providing basic voice assistant functionalities.

Features
Wireless audio streaming via Bluetooth and Wi-Fi
Support for multiple audio formats (MP3, WAV, etc.)
Integration with online music services (e.g., Spotify, internet radio)
Compact and portable design
Voice command support using a microphone
Control via a smartphone app or web interface
Block Diagram
Block diagram of ESP 32 Based Audio Player
Audio Files and Arduino IDE Audio Files
This is the most important part of this project. To play audio sounds on the ESP32 board, we need audio files in .wav format because ESP32 can play an audio file in .wav format only.
First of all we must be make the audio file ready that we want to play in our speaker. You can also record your own audio file in this case.
After that, download and install the Audacity Audio Editor App. This app will be used to change the file type, Sample Rate, and other properties.
Audacity
Once the installation is complete, open the Audacity app and then go to file > Open and select the audio file to edit.
Audacity
The first thing that needed to be changed is the sampling rate. For playing an audio file on ESP32, a sampling rate of 8000 to 16000 will be good as ESP32 doesn’t have much memory. So change the Project Rate to 16000.
Audacity
After that, navigate to File > Export > Export as WAV to save the audio file in .wav format.
Audacity
Now in the next window, select WAV as file type and Unsigned 8-bit PCM as an Encoding format and then click on Save.
Audacity
Now we need a Hex Editor app to generate Hex codes for the audio file. So download and install the Hex Editor (HxD) from the given link. We can also use any hex editor as per the comfort. I have used editor in my case. After that, open the app, then go to File > open and open the .wav file. This will generate the Hex code for the .wav file.
2
1
3
Then use ctrl+A to select the complete code and then go to Edit > Copy as > C to copy the code in C Language format.
hex editor
Then paste this code into sound.h part in Arduino IDE.
Coding
We are using ESP-32 as our main controller so, we must add esp 32 board from board manager of arduino IDE.
ESP-32 Board link for Arduino IDE : https://dl.espressif.com/dl/package_esp32_index.json
Here, we are going to use the XT DAC Audio library from XTronical. The XT DAC Audio library can be downloaded from here.
Once you download XT DAC Audio library in zip format you must add the library in your arduino IDE.
Setting audio library in arduino IDE
Once you add the library, you can conform weather the library is added to arduino IDE by going to example section.
Setting audio library in arduino IDE
If it is successfully added, you can see XT_DAC_Audio at the end of the example section. You can also open and upload wavspeed code to test weather the hardware is properly functioning or not.
It contain two file Wavspeed main file and sound.h file. Wavspeed contain the main code and sound.h contain the hex code of the audio file.
main file
sound.h file
select the respective board and port from the arduino IDE. Upload the code to esp 32 and enjoy with the audio output in your speaker.
Setting audio library in arduino IDE
Adding your own audio file
If you want to add your own audio file then you can download the code below:
codeDownload
Once you extract this you can two file here:

open code.ino file

Go to sound.h section. and replace it with the respective audio hex code. I have already discussed how we generate audio hex code above:

once you paste your hex file in sound.h section. make sure your data type must be const unsigned char as below:

PCB File

3d View

Real PCB

Conclusion
The E-Speaker using ESP32 is a cost-effective and feature-rich project that combines the power of modern microcontrollers with smart audio functionality. It is ideal for DIY enthusiasts looking to explore IoT and audio electronics. With its scalability and flexibility, the project opens the door to numerous enhancements and integrations.
E-Speaker Using ESP32
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(1)
- Likes(6)
-
Engineer
May 26,2025
-
Yehor Kirieiev
Feb 18,2025
-
MANORANJAN DAS
Jan 29,2025
-
Rabin Poudel
Jan 25,2025
-
Kapacita twentytwouF
Jan 25,2025
-
Luis José Mora Díaz
Jan 18,2025
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Rabin Poudel
-
Flood Detection and warning system using LORA and Arduino
IntroductionFloods are one of the most devastating natural disasters, causing immense damage to life...
-
DIY LED Decoration Tiny Star PCB Project
IntroductionThe Tiny Star PCB is a small and fun DIY electronics project that is perfect for hobbyis...
-
Simple and Cheap Clap Switch Circuit
IntroductionThe Simple and Cheap Clap Switch Circuit is a practical and fun DIY electronics project ...
-
Arduino-based Mist Maker and Hand Dryer
IntroductionIn today’s world, automation and hygiene have become essential, especially in public pla...
-
MPL3115A2 Barometric Pressure, Altitude, and Temperature Sensor
IntroductionThe MPL3115A2 is a highly accurate, low-power digital barometric pressure sensor from NX...
-
E-Speaker Using ESP32
IntroductionThe E-Speaker is a smart, portable, and versatile audio system built using the ESP32 mic...
-
Heart Rate Monitor Circuit Using Photoplethysmography (PPG)
IntroductionHeart rate is a vital physiological parameter that reflects the health and fitness of an...
-
Automated Greenhouse Control System using ESP32
IntroductionAn automated greenhouse control system leverages technology to optimize plant growth con...
-
STD CH330N USB to Serial Converter 5V
IntroductionThe CH330N is a versatile USB-to-serial converter chip that simplifies interfacing betwe...
-
KY-032 Obstacle avoidance sensor module
IntroductionIntroduction to Obstacle Avoidance SensorsObstacle avoidance sensors are essential compo...
-
BC547 BASED WATER LEVEL INDICATOR
IntroductionA water level indicator using a BC547 transistor is a simple and effective electronic pr...
-
How to Design Own Arduino Wifi shield PCB
OverviewArduino wifi shield connects the Arduino with a wifi chip through the serial communication p...
-
DIY Air Quality Tester
OverviewIn this project “DIY Air Quality Tester” we use Node MCU microcontroller and air quality sen...
-
Digital Clock Using Arduino
OverviewIn this project, “Digital clock using Arduino” we will make a PCB board for digital clock an...
-
Bluetooth Controlled car using Arduino
OverviewA Bluetooth Controlled Car Using Arduino is a fascinating DIY project that involves building...
-
IoT-Based Automatic Street Light Controller Using ESP32
IntroductionThis system uses ESP32 modules to control street lights through a centralized IoT server...
-
SEPIC DC-DC Converter Using the MT3608 Boost IC
IntroductionModern electronic design must prioritize effective and adaptable power management, parti...
-
Audio Peak Detector using LMV358
IntroductionAn Audio Peak Detector is an essential circuit in audio signal processing that identifie...
-
-
AEL-2011 Power Supply Module
337 0 1 -
AEL-2011 50W Power Amplifier
315 0 1 -
-
-
Custom Mechanical Keyboard
573 0 0 -
Tester for Touch Screen Digitizer without using microcontroller
240 2 2 -
Audio reactive glow LED wristband/bracelet with NFC / RFID-Tags
241 0 1 -
-
-







