About this project

Audio Tools is a header-only C++ library for audio processing on embedded platforms, distributed as an Arduino library and as a CMake C++ library, with support for PlatformIO and ESP-IDF. Its design follows Arduino conventions: processing is started and stopped with begin() and end(), and audio data flows through Stream-like abstractions. Core concepts - Audio Sources and Audio Sinks: read audio data from sources and write it to sinks, mirroring the familiar Arduino Stream model. - Encoders and Decoders for formats such as MP3, AAC, WAV and FLAC, used through EncodedAudioStream. - AudioPlayer and VideoPlayer classes for playback scenarios. - USB audio input and output, including USB Audio Class 2.0. - Integration with various DSP libraries. - Communication of audio over wired or wireless links. - Sound generators (for example sine tones) used with GeneratedSoundStream. - Sound effects such as Boost, Distortion, Echo and Reverb via AudioEffectStream. - A 3-band equalizer. - Converters for ConverterStream and filters for FilteredStream. - Musical notes with their frequencies. - Buffer implementations for QueueStream. - A repeating timer for sampling audio at exact times, used with TimerCallbackAudioStream. - Desktop integration: Arduino audio sketches can be built to run on Linux, Windows and macOS. The library acts as glue that lets different audio components and optional libraries work together. Each stream has its own configuration object passed to begin(); defaultConfig() provides a starting point that usually works, and configuration parameters are documented in the class reference. Examples can often be adapted by swapping stream classes, for example replacing I2SStream with AnalogAudioStream to get analog instead of digital output. A simple example streams a file from flash memory to I2S: a MemoryStream holds the audio data, an I2SStream is configured in TX mode with sample rate, channels and bits per sample, and a StreamCopy object copies data from the memory stream into the I2S stream inside loop(). Logging is built in, defaults to warning level and Serial output, and can be changed with AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Debug). Valid levels are Debug, Info, Warning and Error. Logging can be disabled by setting USE_AUDIO_LOGGING to false in AudioConfig.h to reduce memory usage. Documentation and support - A wiki provides tutorials, an introduction, examples, and notes on optional libraries and running sketches on the desktop. - Generated class documentation is organized by topic and alphabetically. - The project asks users to read documentation and search existing issues and discussions before posting; issues are intended for bugs, while other questions belong in discussions. Reports should include the scenario or sketch, the goal, hardware, software and library versions, and the exact problem. Installation - Download the library as a zip and use Library -> zip library in the Arduino IDE, or clone the repository into the Arduino libraries folder. Git is recommended for easy updates via git pull. Information for other platforms is available in the wiki. The project is licensed under GPL v3 and offers optional sponsorship links.