Fast Audio Codecs for Microcontrollers

My AudioTools project is supporting quite a few audio encoders and decoders. They are critical to reduce the storage or transmission volume of audio. Though I support the encoding of AAC and MP3, I can’t really recommend this: it requires a lot of memory and processing time. For an introduction how to use the codecs, please read the Wiki. Below you can find my short list of my favorite codecs which are fast and efficient. Read more…

ArduinoAudioTools: Playing Movies ?

In my last post I was writing about audio containers. But containers are usually also used to mux audio and video together in one file. This made me think, if we could play movies on an ESP32? In fact there are some projects out there that exactly do this: They used Motion-Jpeg to play the movie and store the audio in a separate file, so they actually avoided the complexity of containers. A mjpeg is Read more…

Arduino Audio Tools: Codecs and Containers

So far I have created quite a few posts about the supported codecs, but I never provided any detailed information how things work behind the scene. Audio codecs are used to compress and decompress PCM audio data. I tried to eliminate all the complexity but sometimes it helps to know how things are working, so from an API point of view you can just stream audio PCM data to an encoder and stream (compressed) encoded Read more…

ESP32 Memory Management: floats and MALLOC_CAP_32BIT

We can dynamically allocate memory with malloc() or use the dedicated ESP32 specific functions. In general we need to use byte aligned allocations (MALLOC_CAP_8BIT). When we have used up all available memory space, we still have 4 byte aligned memory available that we can use to store arrays of int32_t data. Unfortunately we can not use this to store floats. Here is the info from the documentation: Please note that on ESP32 series chips, MALLOC_CAP_32BIT Read more…

Arduino Audio Tools – RTSP Revisited

Quite some time ago, I was describing how we can stream audio with the help of RTSP. In that example we needed to provide a data stream from which we can read the audio! This is not very flexible and often we want to specify RTSP as output: e.g. in the AudioPlayer we want to tell to send the audio to a RTSP stream. Therefore I decided to extend the functionality a bit by supporting Read more…

Arduino AudioTools – FormatConverterStream

I am currently providing quite a few audio processing classes which can be used to change the audio format. So far, the FormatConverterStream could be used to change the bits_per_sample and the number of channels only. I thought it might be cool, if we could use this class for changing the sample rate as well, so I finally managed to commit this change! Here is an example which changes The sample rate from 32000 to Read more…

Mozzi and the AudioKit – Reading Audio Data

I have extended the I2S interface in Mozzi, so that we can can use the getAudioInput() which reads the audio via I2S: This can be used e.g. by the AudioKit. Until this change has been merged, you need to use my extended project. Mozzi brings your Arduino to life by allowing it to produce much more complex and interesting growls, sweeps and chorusing atmospherics. These sounds can be quickly and easily constructed from familiar synthesis Read more…

Playing Commodore 64 SID Audio Files on Microcontrollers or the Desktop

In the old days I was rather a Commodere PC guy, but I know of colleagues of mine that were addicted to the Commodore 64 and knew it inside out. So, here is another project that makes you feel nostalgic: Sound Interface Device (SID) is a audio format used by the Commodore 64. To get some SID files, I can recommend The High Voltage SID Collection (HVSC) which is a freeware hobby project that organizes Read more…

Arduino AudioTools: ESP32 vs RP2040 Pico W

I thought it might be interesting to compare the Rasperry Pico W with the ESP32. While the ESP32 provides faster numeric operations, I did not have any visibility how these two microcontrollers compare in regard of the WIFI speed. The good news is, that the URLStream from the AudioTools library is working now properly for the Pico W as well, so we can use it to measure the thruput! Measuring the Speed I used the Read more…