This project allows you to playback raw wave and sbc encoded audio files via PWM output on NRF52 chips. It can also easily extended to add other decoders of your choice.
- Build on the latest NRF connect SDK 1.7.0
- Supported is a sampling rate up to 32kHz and 8-bit resolution
- C++ is used
For testing, you can connect your headphone to the PWM output. In order to connect a speaker, you'll need an amplifier. A simple Class D Amplifier did the job for me.
A big thanks goes to Tamas Harczos. His initial repository helped me tones to make this player working.
- latest NRF connect SDK 1.7.0
- NRF52 module with PWM support (Tested with the NRF52840 Dongle)
-
Checkout the repository
git clone git@github.com:don41382/nrf52-pwm-wav-sbc-decoder-player.git
-
Build & flash with west (with my nrf52840 dongle)
# west build --board nrf52840dongle_nrf52840 # west flash --softreset
I created a simple bash script (files/decode.sh
) which helps you to convert your audio file into a C header file.
# cd files
# ./decode -sbc hit.mp3
# cd files
# ./decode -raw itsworking.mp3