Skip to the content.

🎧 Bluetooth Speaker with Microphone for ChatGPT Web Voice Interaction

This project implements a Bluetooth audio device using the ESP32 microcontroller, functioning as both a Bluetooth speaker and microphone. The ESP32 connects to a phone or computer via Classic Bluetooth, enabling two-way voice interaction with ChatGPT web or app interfaces that support voice input/output.

✅ System Overview


🔁 Flowchart of Voice Interaction

       +--------------------+
       |   ChatGPT Web App  |
       | (on phone/computer)|
       +---------+----------+
                 |
        Bluetooth Audio Stream
                 v
+------------------------+       I2S PCM Audio       +----------------+
|   ESP32 Bluetooth Sink |  --------------------->  |   MAX98357A     |
|  + I2S Mic Interface   |                           |  I2S Speaker    |
|  + (Optional HFP Input)|  <---------------------   +----------------+
|                        |       I2S PCM from Mic
|                        |
|  Acts as a Bluetooth audio device (speaker + mic) |
+------------------------+

🛠️ Features


✅ Tested Workflow

Step Description
1️⃣ ESP32 is powered up and begins Bluetooth pairing
2️⃣ User connects phone/computer to “ESP32_Speaker” via Bluetooth
3️⃣ User opens ChatGPT Web with voice enabled
4️⃣ Microphone input is captured by ESP32 and sent to device
5️⃣ ChatGPT replies with audio, played back via the ESP32’s speaker

⚠️ Limitations


❗ Challenges Faced

Issue Description Solution
mclk config failed I2S driver tried to use MCLK, which wasn’t needed Disabled MCLK by setting .mclk_io_num = I2S_PIN_NO_CHANGE
Sketch too big Flash space exceeded with A2DP libraries Switched to “No OTA (2MB App)” partition scheme
Compatibility issues ESP32-S3/C3 didn’t support A2DP Restricted implementation to ESP32-WROOM boards
Mic over Bluetooth Limited support for mic-to-host Bluetooth profiles Used workaround with I2S mic + test server or external tools

🧪 Test Results

Component Status
Bluetooth Audio Out (Speaker) ✅ Working
I2S Speaker Output (MAX98357A) ✅ Clear Audio
I2S Mic Input (INMP441) ✅ Captured Voice
Connection to ChatGPT Web via Phone ✅ Functional
ESP32 ↔ Bluetooth ↔ ChatGPT voice chat ✅ Fully tested