All Projects → igorski → Mwengine

igorski / Mwengine

Licence: mit
Audio engine and DSP for Android, written in C++ providing low latency performance in a musical context, supporting both OpenSL and AAudio.

Programming Languages

java
68154 projects - #9 most used programming language
cpp
1120 projects
cplusplus
227 projects

Projects that are alternatives of or similar to Mwengine

Awesome Web Audio
A list of resources and projects to help learn about audio
Stars: ✭ 73 (-61.58%)
Mutual labels:  audio, audio-processing, audio-library
Libopenshot Audio
OpenShot Audio Library (libopenshot-audio) is a free, open-source project that enables high-quality editing and playback of audio, and is based on the amazing JUCE library.
Stars: ✭ 120 (-36.84%)
Mutual labels:  audio, audio-processing, audio-library
Dawdreamer
Digital Audio Workstation with Python; VST instruments/effects, parameter automation, and native processors
Stars: ✭ 119 (-37.37%)
Mutual labels:  audio, audio-processing
Audio
Generic Go package designed to define a common interface to analyze and/or process audio data
Stars: ✭ 129 (-32.11%)
Mutual labels:  audio, audio-library
Scaper
A library for soundscape synthesis and augmentation
Stars: ✭ 186 (-2.11%)
Mutual labels:  audio, audio-processing
Libaudiodecoder
The Cross-Platform Audio Decoder API
Stars: ✭ 114 (-40%)
Mutual labels:  audio, audio-library
Edsp
A cross-platform DSP library written in C++ 11/14. This library harnesses the power of C++ templates to implement a complete set of DSP algorithms.
Stars: ✭ 116 (-38.95%)
Mutual labels:  audio, audio-processing
Cscore
An advanced audio library, written in C#. Provides tons of features. From playing/recording audio to decoding/encoding audio streams/files to processing audio data in realtime (e.g. applying custom effects during playback, create visualizations,...). The possibilities are nearly unlimited.
Stars: ✭ 1,768 (+830.53%)
Mutual labels:  audio, audio-library
Audio Snr
Mixing an audio file with a noise file at any Signal-to-Noise Ratio (SNR)
Stars: ✭ 100 (-47.37%)
Mutual labels:  audio, audio-processing
Dtln
Tensorflow 2.x implementation of the DTLN real time speech denoising model. With TF-lite, ONNX and real-time audio processing support.
Stars: ✭ 147 (-22.63%)
Mutual labels:  audio, audio-processing
Prism Media
Easily transcode media using Node.js 🎶
Stars: ✭ 136 (-28.42%)
Mutual labels:  audio, audio-processing
Img Encode
Encode an image to sound and view it as a spectrogram - turn your images into music
Stars: ✭ 157 (-17.37%)
Mutual labels:  audio, audio-processing
Fradioplayer
A simple radio player framework for iOS, macOS, tvOS.
Stars: ✭ 183 (-3.68%)
Mutual labels:  audio, audio-library
Miniaudio
Single file audio playback and capture library written in C.
Stars: ✭ 1,889 (+894.21%)
Mutual labels:  audio, audio-library
Aukit
audio toolkit. 好用的语音处理工具箱,包含语音降噪、音频格式转换、特征频谱生成等模块。
Stars: ✭ 105 (-44.74%)
Mutual labels:  audio, audio-processing
Noise reduction
Speech noise reduction which was generated using existing post-production techniques implemented in Python
Stars: ✭ 130 (-31.58%)
Mutual labels:  audio, audio-processing
Awesome Deep Learning Music
List of articles related to deep learning applied to music
Stars: ✭ 2,195 (+1055.26%)
Mutual labels:  audio, audio-processing
Termux Ndk
android-ndk for termux
Stars: ✭ 91 (-52.11%)
Mutual labels:  ndk, android-ndk
Mad Twinnet
The code for the MaD TwinNet. Demo page:
Stars: ✭ 99 (-47.89%)
Mutual labels:  audio, audio-processing
Avdemo
Demo projects for iOS Audio & Video development.
Stars: ✭ 136 (-28.42%)
Mutual labels:  audio, audio-processing

MWEngine is..

...an audio engine for Android, compatible with Android 4.1 and up, using either OpenSL or AAudio (when available) as the drivers for low latency audio performance.

MWEngine provides an architecture that allows you to work with audio within a musical context. It is easy to build upon the base classes and create your own noise generating mayhem. A few keywords describing the out-of-the-box possibilities are:

  • tempo-based sequencing with support for alternative time signatures
  • on-the-fly audio synthesis
  • multi-channel audio output
  • effect chains operating on individual input/output channels
  • sample playback with real time pitch shifting
  • live recording and processing from your device's inputs (e.g. microphone)
  • bouncing output to WAV files, either live (during a performance) or "offline"

How does this relate/compare to Google Oboe ?

Though MWEngine was initially created before Oboe, its underlying audio drivers are the same as Google Oboe uses, MWEngine and Oboe are merely different abstraction layers to solve the same problem.

Additionally, MWEngine provides a complete audio sequencing and processing environment with built-in effects without you needing to write/know C(++) to use it.

What apps are using MWEngine ?

The engine has been written for both MikroWave and Kosm to provide fast live audio synthesis.

While development on aforementioned apps has (practically) been discontinued, the engine itself has over the years been continuously updated to be of use to third party app developers, such as TIZE - Beat Maker, Music Maker and Another Flamenco Compás App.

C++ ??? What about Java / Kotlin ?

Though the library is written in C++ (and can be used solely within this context), the library can be built using JNI (Java Native Interface) which makes its API expose itself to Java / Kotlin, while still executing in a native layer outside of the JVM. In other words : high performance of the engine is ensured by the native layer operations, while ease of development is ensured by delegating application logic / UI to the realm of the Android Java SDK.

Whether you intend to use MWEngine for its sample based playback or to leverage its built-in synthesizer and audio processing, you are not required to write any additional C++ code. If you however intend to create your own DSP or synthesis routines (which is fun to do!) you must write them in C++, but can rely on SWIG for making them usable in Java.

A note on garbage collection and SWIG

It is important to note that when a Java object finalizes (i.e. all its references are broken and is garbage collected), the destructors of the native objects are invoked, which can lead to unpredictable results if you happen to overlook this! As such, audio engine objects such as effects processors or events that are created on the Java side, must hold strong references during their lifecycle.

The Issue Tracker is your point of contact

Bug reports, feature requests, questions and discussions are welcome on the GitHub Issue Tracker, please do not send e-mails through the development website. However, please search before posting to avoid duplicates, and limit to one issue per post.

Vote on existing feature requests by using the Thumbs Up/Down reaction on the first post.

Development setup

You will need the following development kits:

And the following toolchains:

  • Gradle to run all build commands
  • CMake to build the native layer code
  • SWIG to wrap the native layer code in Java classes

If you use Android Studio you can simply open the project folder and sync the project with the build.gradle file, after which you will be prompted in case you need to install any of the above (as Android Studio can resolve and install the dependencies for you).

Though depending on your platform, you might need to install SWIG manually (as well as adding it to your path variables). SWIG is readily available from most package managers such as brew on macOS or apt-get on Linux).

Build configurations

The build configurations are defined in:

  • build.gradle (the usual setup, build and deploy toolchain for Android)
  • CMakeLists.txt (for the native layer code)

If you are uncomfortable with C development, you can ignore the make file as all build commands are executed through Gradle.

Building using Android Studio

If you are using Android Studio, creating a project from the supplied build.gradle file should suffice to get you to build both the native and Java code as well as enabling building, debugging and packaging an Android application directly from the IDE.

Upon opening the project file, the native layer library should be built automatically (if not, run Build > Make Project), which will create the wrapper Java classes under the nl.igorski.mwengine.core-namespace.

You can build and deploy using debug and release configurations as usual.

NOTE: on first run there is a known issue where Android Studio is not aware Java classes have been generated after completing the native library build (e.g. the /nl/igorski/mwengine/core-folder containing files but the IDE not recognizing the files - though oddly enough compiling just fine -). Closing and reopening the project window should suffice. If that should still fail, navigate to the /java/nl/igorski/mwengine/core/-folder in the Project panel, right click the folder and Unmark this directory as sources root using the "Mark directory as"-submenu.

Building using CLI

The usual Gradle commands to build and sign a release APK file can be reused. In case you require more fine grained control (as in: you're building MWEngine solely as a library and not within a standalone application), you can execute the following Gradle commands for your CI integration:

Cleaning all generated output
gradle clean

This task will delete the build output as well as previously built native code and generated Java wrappers.

gradle externalNativeBuildRelease

This task will create a release build of the native layer code and generate the Java wrappers. If you are not packaging the MWEngine library and wrapped Java code directly into your application and intend to move the build output as a dependency of another project, you would like to copy these files in an additional build step:

  • build/intermediates/cmake/release/obj/*
  • /src/main/java/nl/igorski/mwengine/*

Where the first contains the native library and its wrapper divided into subdirectories (one for each supported CPU architecture) and the latter contains the Java code and interface layer. These can be copied to your projects source folder, note that native code should go to the /libs folder (if you haven't specified a custom jniLibs location).

Example structure:

├── libs
│   ├── armeabi-v7a
│   │   ├── libmwengine.so
│   │   └── libmwengine_wrapped.so
│   ├── arm64-v8a
│   │   ├── libmwengine.so
│   │   └── libmwengine_wrapped.so
│   └── x86_64
│       ├── libmwengine.so
│       └── libmwengine_wrapped.so
└── src
    └── main
        └── java 
            └── nl
                └── igorski
                    └── mwengine
                        ├── core
                        │   └── ...java
                        ├── definitions
                        │   └── ...java
                        ├── helpers
                        │   └── ...java
                        └── MWEngine.java

Preferably you would make MWEngine's gradle file a submodule of your custom application Gradle file.

FAQ / Troubleshooting

The contents of this repository should result in a stable library and example application. If you experience issues with the setup, consult the Troubleshooting Wiki page.

Documentation

You can view the Wiki (which documents all of the engine's actors as well as a variety of real world use cases) here:

https://github.com/igorski/MWEngine/wiki

Note that you can also view the contents of the header files to get more details about the inner workings of each class.

Unit tests

The library comes with unit tests (/src/main/cpp/tests/), written using the Googletest C++ testing framework.

To enable unit testing upon each build / during development:

  • update local.properties to include the line: enable_tests=true

Note: adb must be available in your global path settings and the attached device / emulator must have the x86_64 CPU architecture (see CMakeLists.txt).

Demo

The repository contains an example Activity that is ready to deploy onto any Android device/emulator supporting ARM-, ARMv7-, x86- architecture and running Android 4.1 or higher. The example will demonstrate how to quickly get a musical sequence going using the library.

To install the demo: first build the library as described above, and then run the build script to deploy the .APK onto an attached device/emulator (note that older emulated devices can only operate at a sample rate of 8 kHz!).

Contributors

MWEngine has received welcome contributions (either suggestions on improving the API or proposal of new features, solving of bugs, etc.) from the following developers :

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].