• Stars
    star
    1,400
  • Rank 33,575 (Top 0.7 %)
  • Language
    C
  • License
    GNU General Publi...
  • Created over 3 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Arduino Audio Tools (a powerful Audio library not only for Arduino)

Arduino Audio Tools

Some basic header-only C++ classes that can be used for Audio Processing provided as Arduino and cmake C++ Library:

This functionality provides the glue which makes different audio processing components and libraries work together. We also provide plenty of examples that demonstrate how to implement the different scenarios. The design philosophy is based on the Arduino conventions: we use the begin() and end() methods to start and stop the processing and we propagate the use of Streams. We all know the Arduino Streams: We usually use them to write out print messages and sometimes we use them to read the output from Serial devices. The same thing applies to “Audio Streams”: You can read audio data from “Audio Sources” and you write them to “Audio Sinks”.

As “Audio Sources” we will have e.g.:

As “Audio Sinks” we will have e.g:

Examples

Here is an simple example which streams a file from the Flash Memory and writes it to I2S:

#include "AudioTools.h"
#include "StarWars30.h"

uint8_t channels = 2;
uint16_t sample_rate = 22050;

MemoryStream music(StarWars30_raw, StarWars30_raw_len);
I2SStream i2s;  // Output to I2S
StreamCopy copier(i2s, music); // copies sound into i2s

void setup(){
    Serial.begin(115200);

    auto config = i2s.defaultConfig(TX_MODE);
    config.sample_rate = sample_rate;
    config.channels = channels;
    config.bits_per_sample = 16;
    i2s.begin(config);
}

void loop(){
    copier.copy();
}

Each stream has it's own configuration object that should be passed to the begin method. The defaultConfig() method is providing a default proposal which will usually "just work". Please consult the class documentation for the available configuration parameters. You can also easily adapt any provided examples: If you e.g. replace the I2SStream with the AnalogAudioStream class, you will get analog instead of digital output.

I suggest you continue to read the more detailed introduction.

Further examples can be found in the Wiki.

Dependent on the example you might need to install some addional libaries

AudioPlayer

The library also provides a versatile AudioPlayer. Further information can be found in the Wiki

Logging

The application uses a built in logger (see AudioLogger.h and AudioConfig.h). You can e.g. deactivate the logging by changing USE_AUDIO_LOGGING to false in the AudioConfig.h:

#define USE_AUDIO_LOGGING false
#define LOG_LEVEL AudioLogger::Warning
#define LOG_STREAM Serial

Per default we use the log level warning and the logging output is going to Serial. You can also change this in your sketch by calling AudioLogger begin with the output stream and the log level e.g:

AudioLogger::instance().begin(Serial, AudioLogger::Debug);

Show and Tell

Get some inspiration from projects that were using this library or share your projects with the community.

Documentation

Please use this before you raise any issue or start a discussion!

Support

I spent a lot of time to provide a comprehensive and complete documentation. So please read the documentation first and check the issues and discussions before posting any new ones on Github.

Open issues only for bugs and if it is not a bug, use a discussion: Provide enough information about

  • the selected scenario/sketch
  • what exactly you are trying to do
  • your hardware
  • your software versions
  • what exactly your problem is

to enable others to understand and reproduce your issue.

Finally, don't send me any e-mails or post questions on my personal website!

Installation in Arduino

You can download the library as zip and call include Library -> zip library. Or you can git clone this project into the Arduino libraries folder e.g. with

cd  ~/Documents/Arduino/libraries
git clone https://github.com/pschatzmann/arduino-audio-tools.git

I recommend to use git because you can easily update to the latest version just by executing the git pull command in the project folder. If you want to use the library in PlatformIO, you can find a detailed description in the Wiki.

Sponsor Me

This software is totally free, but you can make me happy by rewarding me with a treat

More Repositories

1

ESP32-A2DP

A Simple ESP32 Bluetooth A2DP Library (to implement a Music Receiver or Sender) that supports Arduino, PlatformIO and Espressif IDF
C++
1,599
star
2

arduino-audiokit

Arduino ADF/Audiokit HAL (support for ESP32-A1S, AI-Thinker, LyraT for ES7148, ES7210, ES7243, ES8311, ES8347, ES8388, TAS5805M, AC101 audio chips)
C
155
star
3

logic-analyzer

Arduino Logic Analyzer API supporting the SUMP protocol (for sigrok, pulseview)
C++
106
star
4

arduino-libhelix

A simple MP3 and AAC Decoder (not only) for Arduino based on libhelix
C
68
star
5

pico-arduino

Arduino API Library for the Raspberry Pico
C
62
star
6

arduino-audio-driver

Flexible driver library for audio boards and codec chips e.g AC101 ES8388 ES8311 CS43l22 ES7243 etc
C
57
star
7

esp32_radio

Web Radio Player which is also working with a ESP32 Micro Controller
Vue
46
star
8

arduino-stk

The Synthesis ToolKit in C++ (STK) Library for Arduino
C++
42
star
9

arduino-snapclient

Snapcast client for Arduino
C++
37
star
10

Arduino-Emulator

A simple Arduino Emulator that can be used in Windows, Linux or OS/X
C++
34
star
11

arduino-midi

Midi support for Arduino (Midi over Serial, Bluetooth, BLE and TCP/IP, Apple MIDI)
C
26
star
12

arduino-flite

A small fast portable speech synthesis system
C
25
star
13

esp32_vue_example

C++
24
star
14

arduino-espeak-ng

eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.
C
22
star
15

arduino-vs1053

An Arduino library for VS1053, VS1003 Codec Breakout Boards
C++
21
star
16

rp2040-i2s

Work in progress...
C
20
star
17

arduino-liblame

A simple mp3 encoder (not only) for Arduino using LAME
C
20
star
18

arduino-SAM

Software Automatic Mouth - Tiny Speech Synthesizer
C
20
star
19

arduino-libmad

A simple mp3 decoder (not only) for Arduino using libmad
C
19
star
20

stm32-i2s

I2S Arduino Library for STM32 Microcontrollers
C++
19
star
21

arduino-fdk-aac

A simple AAC Encoder and Decoder library (not only) for Arduino
C++
18
star
22

ArduinoMavlinkDrone

A Simple Arduino Mavlink Drone Library e.g. to implement a RC airplane which uses QGroundControl as Remote Controller.
C
18
star
23

arduino-libopus

The Opus Codec for Arduino
C
17
star
24

jupyterlab-viewer-3d

A JupyterLab extension for rendering 3d files (stl, amf, obj, 3mf, gcode, collada)
TypeScript
13
star
25

arduino-simple-tts

A simple TTS solution based on pre-recorded audio
C
13
star
26

TinyHttp

Arduino Http Server
C++
13
star
27

jupyter-openscad-kernel

Jupyter kernel for OpenSCAD
Python
11
star
28

arduino-libsbc

sbc codec library for Arduino
C
11
star
29

SIDPlayer

Playing Commodore 64 SID Audio on Arduino
C
10
star
30

SpektrumSatellite

Spektrum Satellite protocol for Arduino
C++
10
star
31

TinyFTPClient

Remote Files - A simple Arduino FTP client library (for all architectures)
C++
9
star
32

arduino-libflac

libflac codec library for Arduino
C
7
star
33

arduino-freertos-addons

Additions to FreeRTOS: C++ API
C++
7
star
34

arduino-libvorbis-tremor

Vorbis decoder
C
7
star
35

adpcm

Lean ADPCM codec implementation from FFMpeg
C
7
star
36

smart-EDGAR

EDGAR XBRL Processing
HTML
6
star
37

Investor

Easy to use Java Library to implement and evaluate automatic stock trading strategies.
Java
5
star
38

stm32f411-adc

Arduino library for stm32f411 providing ADC via DMA
C++
5
star
39

idf-example-a2dp

Demo which shows how to use the ESP-A2DP library as component in IDF
CMake
4
star
40

openscad-models

OpenSCAD
4
star
41

arduino-midi-fileparser

A simple MIDI file parser library
C
4
star
42

docker-beakerx-lab

Dockerfile for Jupyter Lab with BeakerX kernel
Dockerfile
4
star
43

arduino-fatfs

Work in progress...
C++
4
star
44

arduino-libfaad

Freeware Advanced Audio (AAC) Decoder including SBR decoding
C
4
star
45

arduino-posix-fs

Arduino Posix API for data in PROGMEM - used by espeak-ng
C++
3
star
46

docker-cron

Docker file for time based batch processor which is driven by docker labels using cron syntax
Dockerfile
3
star
47

tinyusb-cpp

A simple C++ extension for TinyUSB
C++
3
star
48

arduino-libg7xx

Reference implementations of the CCITT G.711, G.721 and G.723 voice compressions
C
3
star
49

stm32h7-arduino

Introduction to STM32H743VIT6 using Arduino
C
3
star
50

jupyterlab-openscad-syntax-highlighting

Syntax-Highlighting for OpenSCAD in Jupyterab
JavaScript
2
star
51

RP2040-A2DP

Work in progress..
C++
2
star
52

arduino-dlna

Work in progress
C
2
star
53

docker-data-science

Jupyter Lab with BeakerX kernel including the most important data science libraries
Dockerfile
2
star
54

arduino-lcd

LCD library
C++
2
star
55

jflightcontroller4pi

Simple flight controller for airplanes implemented in Java - for the Raspberry PI (zero)
Java
2
star
56

docker-flume

Dockerfile for apache flume log consolidator on Alpine
1
star
57

docker-websvn

Dockerfile for websvn on Alpine
PHP
1
star
58

docker-h2o

Docker File for H2O.ai
Dockerfile
1
star
59

docker-jenkins

Dockerfile for jenkins on Alpine
1
star
60

docker-svnserve

Docker file for subversion server on Alpine
Dockerfile
1
star
61

scad4j

OpenSCAD generator API for the JDK
Java
1
star
62

docker-cron-impl

Implementation of docker-cron scheduler
JavaScript
1
star
63

Resources

Jupyter Notebook
1
star
64

news-digest

News-Digest: Accessing the History of News Headlines¶
Java
1
star
65

SmartEdgar-Blogs

Jupyter Workbooks using the Smart-EDGAR project
Jupyter Notebook
1
star
66

Investor-ml

Extension for Investor for deeplearning4j
Java
1
star
67

Investor-Blogs

Jupyter Notebooks for the Investor Framework in Scala
Jupyter Notebook
1
star
68

Arduino-Emulator-Target

C++
1
star
69

arduino-libilbc

Arduino iLBC Speech Codec
C
1
star