-
-
Notifications
You must be signed in to change notification settings - Fork 256
Design Principles
Phil Schatzmann edited this page Jan 31, 2025
·
8 revisions
This project is guided by the following goals:
- Use a Header only implementation (so that there is no need for any compiled static or dynamic library).
- Use base concept of Arduino Streams to read and write Audio Data, so that we can easily use the existing Arduino classes as input or output
- Provide a comprehensive and complete set of audio related functionality
- Separate between Core Audio Functionality and Extended Functionality
- Provide all core classes by importing "AudioTools.h":
- Extended functionality which relies on external libraries needs to be imported separately:
- AudioTools/AudioCodecs
- AudioTools/AudioLibs
- Just adding an #include "AudioTools.h" should not impact the program storage and global variables!
- Separate between basic API (e.g I2SStream) and platform specific driver classes: Platform specific differences are handled in AudioConfig.h where you can configure, activate or deactivate specific functionality.
- Try to be as platform independent as possible:
- If compiled outside of Arduino use our own Stream and Print implementation
- Avoid any other Arduino or C++ data structures that might not be available in all platforms (e.g. Arduino String, c++ string)
- Use the AudioConfig.h to define global parameters and platform specific differences
- Support cmake so that software can be built on the desktop and other platforms
- Templated audio classe names that need the audio data type should end with T: e.g CsvStreamT<int16_t>. It is recommended to also provide the corresponding classes w/o type names which either default to int16_t or use the type defined in the audio info. E.g CsvStream is using the data type defined by the bits_per_sample.