Changing the Sample Size to 32 bits (e.g. for an ES9018 DAC)

There are some DACs out there that only support 32 bits: E.g the ES9018K2M module which is sold as high end HIFI DAC. Therefore sometimes it is necessary to change the sample size e.g. from 16 to 32 bits when your codec produces 16 bits. This can be easily done with the help of the NumberFormatConverterStream class of the Arduino Audio Tools library: I2SStream i2s; // final output of decoded stream NumberFormatConverterStream fc(i2s); // write Read more…

Using Mozzi with a Bluetooth Speaker

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 units like oscillators, delays, filters and envelopes. One of the strong points of my AudioTools library is, that we also support extensive communication scenarios. In this example we show how we can output the sound generated by Mozzi to a Bluetooth Speaker using Read more…

I2S Output of 4 Channels with an ESP32

Recently there was a discussion on how to output more then 2 channels via I2S. I2S is limited to 2 channels, but the ESP32 has 2 I2S ports, so we can output a maximum of 4 channels! Arduino Sketch I have added a small example that shows how this can be done using my AudioTools library: #include <SPI.h> #include <SD.h> #include “AudioTools.h” #include “AudioCodecs/CodecMP3Helix.h” const int chipSelect=10; AudioInfo info(44100, 2, 16); I2SStream i2s_1; // final Read more…

Mozzi Revisited

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 units like oscillators, delays, filters and envelopes. Mozzi supports quite a lot of different Micro controllers, but it does not have any output method that would let you capture the audio to a stream of data, so I have added some simple integration Read more…

AudioTools, ESP32 and PSRAM revisited

Arrays The best way to allocate an Array of data in the AudioTools is by using a Vector. E.g. Vector<int16_t> vector{100000}; is allocating a vector of 100’000 2 byte signed integers. RAM and PSRAM The ESP32 has a few hundred kilobytes of internal RAM, residing on the same die as the rest of the chip components. It can be insufficient for audio, so it has the ability to use up to 4 MB of external Read more…

Pure Data (PD) and AudioTools

Pure Data (or just “Pd”) is an open source visual programming language for multimedia. Pure Data is developed by Miller Puckette since 1996 and you can find it on his official website along with the official documentation and other related resources. I wanted to have the possibility to run PD patches on microcontrollers. In order to achieve this I am using the hvcc hcompiler that can translate a pd file to c and c++ code. Read more…

Arduino Audio Tools – Receiving Audio using VBAN

Quite some time ago, I demonstrated how you can send Audio to your mobile phone using the VBAN protocol. Recently I have added support for receiving data to your microcontroller as well. With this you can use this protocol to build some cool two way communictations applications (e.g. walkie-talkie). Arduino Sketch Here is a sketch that receives the data and just outputs the audio with I2S. Just replace the output class with whatever you want! Read more…

STM32F411 Discovery Kit and Arduino: Investigating the I2S Library Quality Issue

In my last post I have complained that my sine wave test sketch was producing just noise. So I am trying now to investigate where the issue is coming from. Using Basic APIs So first, I try an Arduino Sketch which is just using the low level API of my libraries: This configures the codec using the driver API, sets up I2S using the STM32 I2S library and just uses the sine generator from the Read more…

STM32F411 Discovery Kit and Arduino: The I2S Library

In my last post, I was describing that I started to work on adding I2S audio support to the STM32F411 Discovery Board. I finally have my Arduino I2S library that supports the STM32F411 Blackpill and Disovery Board ready. I was completely redesigning the old, mostly generated C library into some C++ classes and I have now a better way to support additional boards. Unfortunately I still don’t have any clean sound on my Discovery Board: Read more…

STM32F411 Discovery Kit and Arduino: Setting up the Audio Chip

Quite some time ago, I started to look into the STM32F411 Discovery Kit with Arduino. Unfortunatly the audio codec i2c address was not showing up in the port scan. I found out that the chip needs to be activated with setPinMode(PD4, OUTPUT); digitalWrite(PD4, HIGH); One of the reasons why I started my arduino-audio-driver project, was that I wanted to have a clean API for the LQFP100 audio chip that is provided by this board. So Read more…