I can only find examples for WAV files. Is it possible to play MP3 files using hardware? Do I need a library?
You would need a library (an MP3 decoder).
LAME is an open source MP3 project that's mostly used for encoding-compressing but it also can decode-decompress.
It's not going to compile and run as-is. It would have to be "ported" to the Giga platform.
Usually with the Arduino, people buy an audio shield that has the MP3 decoding built-into the hardware, and it's also got a DAC, and a slot for an SD card, etc., so the Arduino just acts as a controller. But there is no proper file system and the Arduino can't directly access the SD card so sometimes there are file name limitations and the Arduino can't read the metadata, etc.
Thanks! I'm familiar with some of the shields that have been available for similar functionality. I was hoping to avoid adding one by leveraging the USB A for thumb drive storage for MP3 files and the onboard DAC to handle the audio. Given the Giga's platform including Bluetooth, Audio, and WiFi, I'm hoping that I can port some functionality to the Giga and forgo all of the shields I had used in the past.
Don't take this an an official answer by any means, but a quick search for "stm32 mp3" brings some interesting results:
- MP3 Decoding on STM32G070RBT6 - Page 1
- GitHub - lamilami/stm32-mp3player: Automatically exported from code.google.com/p/stm32-mp3player
- GitHub - lieff/minimp3: Minimalistic MP3 decoder single header library
Will probably not work out of the box, but promising for sure