Solution for receiving BT audio and playing stored audio samples - Page 1
Forum section: electronics / projects

author: freeflyer
author_rank: Contributor
timestamp: May 17, 2025, 04:38:52 pm
content: I am looking for a hardware and embedded software solution to meet the following requirements:1. Receive audio music via bluetooth (classic) i.e. from a smart phone, mp3 player etc2. Play audio music via the bluetooth (classic) through a single miniature speaker (mono)3. Play stored audio samples which are voice prompts that count down numbers at intervals based on altitude (which is measured using a pressure sensor)4. If bluetooth music is being played when the voice prompt is triggered, the music will need to be temporarily attenuated.5. Read pressure from Bosch BME280 sensor to calculate altidue (I2C or SPI interface).6. Powered by lithium battery with built in (wired) chargingPlease refer to the block diagram below...I was hoping I could use the MCU on the bluetooth module for the application software and also to store the voice prompts, if not then I will need an external MCU.An example of how this would sound whilst in use is in the following link....https://www.dropbox.com/scl/fi/wykgrpafdju1yjnjyv0xh/voiceprompt.mp3?rlkey=rojkrzfyyy9aa43fehb84ylmp&dl=0I originally developed this project many years ago using the following parts:- WT32i bluetooth module- dsPIC33EP256MU806 MCU- TLV320AIC32I CODEC- S25FL032P0XMFI011 flash (to store voice prompts in WAV format)- TPA6120A2 audio amplifier- DS2745U battery chargerHowever, the WT32i is end of life and I was hoping to get away without needing an external MCU and external flash by using the bluetooth module MCU and flash (if this is possible ?)What are my options ?

author: darkspr1te
author_rank: Frequent Contributor
timestamp: May 18, 2025, 09:09:07 am
content: the latest ESP32 chips support bt/btle an are fast enough for audio , although most of the projects i have seen used external i2c/spdif DAC with in built audio processing,samples can be stored on spi flash or sdcardscoding can be done in arduino world or straight espidfdarkspr1te

author: freeflyer
author_rank: Contributor
timestamp: May 21, 2025, 06:22:22 pm
content: Thanks darksprite, unfortunately not so clever ChatGPT suggested using the ESP32-S3-DevKitC-1 which I ordered from Pi Hut for £28.But when I tried to build the example code a2dp_sink in Espressif-IDE I got build errors.Then ChatGPT informed me that it made a mistake and that ESP32-S3 does not support bluetooth classic, so that was a waste of money and I now have a board which is of no use to meWhat ESP32 development do you suggest ? I don't trust ChatGPT anymore !

author: darkspr1te
author_rank: Frequent Contributor
timestamp: May 22, 2025, 01:52:43 pm
content: i never seem to get anything good out of AI systems, i think its the way i phrase my questions. Anyway have you tried this,https://github.com/pschatzmann/ESP32-A2DPI miss read that you got S3 not C3, code i posted was for C3,I would have a look at the example and DIY ones people have made, I found a lot of people went the cypress bt+esp32/stm32 as brain /i2c DAC but there are proven examples of esp32 doing BT classic A2DP etc, this is also where you well get good info on which method is better for you route , eg esp32 that can do BT classic audio or a chiplet+mcu solutionI also always look at datasheets , spend half my life in them and thats often where the real info is,darkspr1te

author: bson
author_rank: Unknown
timestamp: May 23, 2025, 10:55:20 pm
content: Another option:Prototype using the nRF52-DK board,https://www.mouser.com/ProductDetail/Nordic-Semiconductor/NRF52-DK($40)This has a Segger J-Link on board. Download the JLink tools to configure it etc.Use an ARM reference toolchain fromhttps://developer.arm.com/downloads/-/gnu-rmDevelop usingVStudioVSCode and suitable extensions (Makefiles, C/C++, Cortex-Debug...)Nordic has a literal crap-ton of sample code, for things like pairing and whatnot, that's easy to just grab and tweak.https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples.htmlWhen you have a prototype running on the nRF53832 dev board you can make you own custom PCB for it easily. No need to live with modules and wires all over. The dev board schematics and layout makes for an excellent reference implementation.Nordic documentation in general is towards the better end of he spectrum.I used exactly the above setup (on Fedora Linux), but to experiment and familiarize myself with ANT+. I think it's really nice and effective.