{"id":18248831,"url":"https://github.com/igorski/mwengine","last_synced_at":"2025-04-06T20:10:34.677Z","repository":{"id":14568946,"uuid":"17284944","full_name":"igorski/MWEngine","owner":"igorski","description":"Audio engine and DSP library for Android, written in C++ providing low latency performance within a musical context, while providing a Java/Kotlin API. Supports both OpenSL and AAudio.","archived":false,"fork":false,"pushed_at":"2024-03-10T22:29:51.000Z","size":2158,"stargazers_count":268,"open_issues_count":18,"forks_count":45,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-03-30T17:11:41.555Z","etag":null,"topics":["aaudio","android","android-ndk","audio","audio-engine","audio-library","audio-processing","c-plus-plus","cplusplus","cpp","java","low-latency","ndk","opensl"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/igorski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-02-28T12:01:31.000Z","updated_at":"2025-03-13T21:43:18.000Z","dependencies_parsed_at":"2024-01-10T08:24:32.320Z","dependency_job_id":"4362e6d6-7475-4991-b4ab-3d8b4d5a3a99","html_url":"https://github.com/igorski/MWEngine","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorski%2FMWEngine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorski%2FMWEngine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorski%2FMWEngine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorski%2FMWEngine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igorski","download_url":"https://codeload.github.com/igorski/MWEngine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543591,"owners_count":20955865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aaudio","android","android-ndk","audio","audio-engine","audio-library","audio-processing","c-plus-plus","cplusplus","cpp","java","low-latency","ndk","opensl"],"created_at":"2024-11-05T09:38:26.180Z","updated_at":"2025-04-06T20:10:34.639Z","avatar_url":"https://github.com/igorski.png","language":"C++","readme":"MWEngine is..\n=============\n\n...an audio engine for Android, compatible with Android 4.1 and up, using either OpenSL or AAudio\n(when available) as the drivers for low latency audio performance.\n\nMWEngine provides an architecture that allows you to work with audio within a _musical context_. It is easy to\nbuild upon the base classes and create your own noise generating mayhem. A few keywords describing the\nout-of-the-box possibilities are:\n\n * tempo-based sequencing with support for alternative time signatures\n * on-the-fly audio synthesis\n * multi-channel audio output\n * effect chains operating on individual input/output channels\n * sample playback with real time pitch shifting\n * live recording and processing from your device's inputs (e.g. microphone)\n * bouncing output to WAV files, either live (during a performance) or \"offline\"\n\n#### How does this relate/compare to Google Oboe ?\n\nThough MWEngine was initially created before Oboe, its underlying audio drivers are _the same as Google Oboe uses_, MWEngine\nand Oboe are merely different abstraction layers to solve the same problem.\n\nAdditionally, MWEngine provides a complete audio sequencing and processing environment with built-in effects\nwithout you _needing to write/know C(++) to use it_.\n\n#### What apps are using MWEngine ?\n\nThe engine has been written for both [MikroWave](https://play.google.com/store/apps/details?id=nl.igorski.mikrowave.free\u0026hl=en) and\n[Kosm](https://play.google.com/store/apps/details?id=nl.igorski.kosm\u0026hl=en) to provide fast live audio synthesis.\n\nWhile development on aforementioned apps has (practically) been discontinued, the engine itself has over the years been continuously updated\nto be of use to third party app developers, such as [TIZE - Beat Maker, Music Maker](https://play.google.com/store/apps/details?id=com.tizemusic.tize)\nand [Another Flamenco Compás App](https://play.google.com/store/apps/details?id=com.harthorst.compas).\n\n### C++ ??? What about Java / Kotlin ?\n\nThough the library is written in C++ (and can be used solely within this context), the library can be built using JNI\n(Java Native Interface) which makes its API expose itself to Java / Kotlin, while still executing in a native layer outside of\nthe JVM. In other words : high performance of the engine is ensured by the native layer operations, while\nease of development is ensured by delegating application logic / UI to the realm of the Android Java SDK.\n\nWhether you intend to use MWEngine for its sample based playback or to leverage its built-in synthesizer and\naudio processing, you are not required to write any additional C++ code. If you however intend to create your own\nDSP or synthesis routines (which is fun to do!) you must [write them in C++](https://github.com/igorski/MWEngine/wiki/Adding-new-components),\nbut can rely on SWIG for making them usable in Java.\n\n##### A note on garbage collection and SWIG\n\nIt is important to note that when a Java object finalizes (i.e. all its references are broken and is garbage collected), the\ndestructors of the native objects are invoked, which can lead to unpredictable results if you happen to overlook this!\nAs such, audio engine objects such as effects processors or events that are created on the Java side, must hold\nstrong references during their lifecycle.\n\n### The [Issue Tracker](https://github.com/igorski/MWEngine/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) is your point of contact\n\nBug reports, feature requests, questions and discussions are welcome on the GitHub Issue Tracker, please _do not send e-mails through the development website_. Please search before posting to avoid duplicates and limit to one issue per post.\nFor usage / implementation related questions, first consult [the MWEngine Wiki](https://github.com/igorski/MWEngine/wiki).\n\nWhen reporting a bug, please describe the expected behaviour and the actual result. When possible, for crashes attach stack traces and recordings for audio related glitches.\n\nVote on existing feature requests by using the Thumbs Up/Down reaction on the first post.\n\n### Development setup\n\nYou will need the following development kits:\n\n * [Android SDK](https://developer.android.com/studio/index.html)\n * [Android NDK](https://developer.android.com/ndk/downloads/index.html) to build the native layer code\n\nAnd the following toolchains:\n\n * [Gradle](https://gradle.org) to run all build commands\n * [CMake](https://cmake.org) to build the native layer code\n * [SWIG](http://www.swig.org) to wrap the native layer code in Java classes\n\nIf you use [Android Studio](https://developer.android.com/studio/) you can simply open the project\nfolder and sync the project with the _build.gradle_ file, after which you will be prompted in case\nyou need to install any of the above (as Android Studio can resolve and install the\ndependencies for you).\n\nThough depending on your platform, you might need to install SWIG\nmanually (as well as adding it to your path variables). SWIG is readily available from\nmost package managers such as _brew_ on macOS or _apt-get_ on Linux).\n\n#### Build configurations\n\nThis repository contains two modules:\n\n * _/mwengine/_ which is the core MWEngine library (native code, Java API wrappers)\n * _/mwengine_example/_ which contains an example Activity bundling the library into an Android app\n\nBoth are referenced in the root level _settings.gradle_ file for a standard multi module setup.\n\nThe build configurations themselves are defined in:\n\n * _build.gradle_ (the usual setup, build and deploy toolchain for Android, per module)\n * _CMakeLists.txt_ (for the native layer code, solely in /mwengine module)\n\nIf you are uncomfortable with C development, you can ignore the makefile as all build commands\nare executed through Gradle.\n\n#### Building the project\n\nUpon checkout this repository does not include the Java API files (_nl.igorski.mwengine.core_-namespace) as\nthese are wrappers and generated by the build. In order to generate these files, you should run the _assemble_\ntask of the _mwengine_-module, e.g.:\n\n```:mwengine:assemble```.\n\nUpon completion, you can run usual debug/deploy targets for the _mwengine_example_-module to start the example application.\nUsing Android Studio you can easily debug native code of the library inside the example Activity using breakpoints.\n\n#### Building MWEngine as a standalone AAR library\n\nWhile you could create your own custom app by cloning this repository and refactoring the example Activity to\nyour needs, it will be far easier to maintain and include future MWEngine updates when you build the core MWEngine\nlibrary as an Android Archive (.AAR) and reference the library within your project.\n\nIn order to do so, you run the following Gradle command:\n\n```:mwengine:assemble```\n\nWhich will generate the library in both debug and release configurations, packaged as AAR files in: _./mwengine/build/outputs/aar/_.\n\n##### Importing the MWEngine AAR library inside your custom project\n\nWithin Android Studio you can easily do this by importing the generated .aar file by navigating through:\n\n```File \u003e Project structure \u003e Dependencies```\n\nAdd a new `Library Dependency` in the `Declared dependencies` tab, select `Jar Dependency`\nIn the `Add Jar/Aar Dependency` dialog, enter the path to your built AAR library `/path/to/mwengine-release.aar`\n\nYour projects _build.gradle_ file will now contain the following line:\n\n```implementation files('/path/to/mwengine-release.aar')```\n\nIn the _build.gradle_ for your application, be sure to add the following entries under the defaultConfig and dependencies sections:\n\n```\nandroid {\n    defaultConfig {\n        // project specific custom stuff here...\n        ndk {\n            // these values must match the ABI's defined in mwengine/build.gradle\n            // to prevent UnsatisfiedLinkError when this app tries to serve an unsupported architecture\n            abiFilters \"armeabi-v7a\", \"arm64-v8a\", \"x86_64\"\n        }\n    }\n}\ndependencies {\n    implementation project(\":mwengine-release\")\n    // project specific custom stuff here...\n}\n```\n\n### FAQ / Troubleshooting\n\nThe contents of this repository should result in a stable library and example\napplication. If you experience issues with the setup, consult the\n[Troubleshooting Wiki page](https://github.com/igorski/MWEngine/wiki/Troubleshooting-MWEngine).\n\n### Documentation\n\nYou can view the Wiki (which documents all of the engine's actors as well as a variety of real world\nuse cases) here:\n\n[https://github.com/igorski/MWEngine/wiki](https://github.com/igorski/MWEngine/wiki)\n\nNote that you can also view the contents of the header files to get more details about the inner\nworkings of each class.\n\n### Unit tests\n\nThe library comes with unit tests (_/src/main/cpp/tests/_), written using the Googletest C++ testing framework.\n\nTo enable unit testing upon each build / during development:\n\n * update _local.properties_ to include the line: _enable_tests=true_\n \nNote: _adb_ must be available in your global path settings and the attached device / emulator\nmust have the x86_64 CPU architecture (see _CMakeLists.txt_).\n\n### Demo\n\nThe repository contains an example Activity that is ready to deploy onto any Android device/emulator supporting ARM-, ARMv7-,\nx86- architecture and running Android 4.1 or higher. The example will demonstrate how to quickly get a musical\nsequence going using the library.\n\nTo install the demo: first build the library as described above, and then run the build script to deploy the .APK onto an\nattached device/emulator (note that older emulated devices can only operate at a sample rate of 8 kHz!).\n\n### Contributors\n\nMWEngine has received welcome contributions (either suggestions on improving the API or proposal of new features,\nsolving of bugs, etc.) from the following developers :\n\n * Andrey Stavrinov (@hypeastrum)\n * Toufik Zitouni \u0026 Robert Avellar (Tize)\n * Koert Gaaikema (@koertgaaikema)\n * Matt Logan (@mattlogan)\n * Thomas Flasche (@harthorst)\n * Rickard Östergård (@rckrdstrgrd)\n * Aran Arunakiri\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorski%2Fmwengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figorski%2Fmwengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorski%2Fmwengine/lists"}