Coder Social home page Coder Social logo

rafal-rozestwinski-forks / arduino-audio-tools2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pschatzmann/arduino-audio-tools

0.0 0.0 0.0 279.15 MB

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

License: GNU General Public License v3.0

C++ 8.00% C 81.90% CMake 0.16% Jupyter Notebook 9.94%

arduino-audio-tools2's Introduction

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 version (from the Boards Manager) and library 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!

Please note that discussions and issues which have already been answered before or where the answer can be found in the documentation may get deleted w/o reply.

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

arduino-audio-tools2's People

Contributors

pschatzmann avatar podaen avatar linusheu avatar alexus2033 avatar andysheen avatar roleroz avatar chrissbarr avatar lbrutti avatar michielfromnl avatar ksaye avatar honeyspoon avatar alexflint avatar gaai avatar fricklr avatar ianloic avatar jeffiel avatar kspotter avatar norman-ritz avatar ut2uh avatar vinay0508 avatar asemy avatar rw-donaldp avatar gary7530 avatar rafal-rozestwinski avatar squix78 avatar thaaraak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.