Code Monkey home page Code Monkey logo

nativeaudioplugins's Introduction

README

This repository hosts the official Unity Native Audio Plugin SDK. It is a standard Unity project that comes with prebuilt plugin effects and custom GUIs for OSX and Windows. Full source code for all plugin effects is provided, both for the native code (Xcode/VisualStudio C++ projects code in the NativeCode folder) as well as the custom GUIs (MonoDevelop project in the GUICode folder).

What license are these demos shipped under?

Like the rest of the Unity open source projects, everything in this repository is released under an MIT/X11 license.

Additional dependencies

While all other scenes in the project are self-contained and self-running, the “teleport” scene demonstrates how to send audio from external applications into Unity. This can either happen through the NativeCode/TeleportDemo.cpp command line program which can act both as a sender or receiver or via the included AUTeleport demo in NativeCode/Xcode/AUTeleport which shows how to send audio from an AudioUnits plugin that can be inserted in the output bus of sequencers like Logic and send audio data from there into the native audio plugin on the Unity side. A prebuilt version of the plugin is included, but if you want to build it yourself, you need to download the additional “Core Audio Utility Classes” source code from Apple as mentioned in NativeCode/Xcode/AUTeleport/readme.txt

Further information

For diagrams describing some of the demos and techniques used see the slides from Unite Europe 2015

nativeaudioplugins's People

Contributors

alexxunity avatar janmunity avatar m-dejean-unity avatar monroeberg avatar philz-unity avatar schroedingers-cat avatar tak avatar tautvydaszilys avatar utjkaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nativeaudioplugins's Issues

how to use it? any tutorial?

I guess this SDK can be import as C++ dll in C# script? like Dllimport[...], or add dll in plugin folder? but this repo is like a project? how to install this SDK? download this repo and copy to unity projects? don't get it..

basic question, hope get the answer...

Multiband attack and release are broken

This commit:
fd08cdc

Changed the lines from:
atk = GetTimeConstant(0.99f, _atk); rel = GetTimeConstant(0.99f, _rel);
to:
atk = GetTimeConstant(0.99f, atk); rel = GetTimeConstant(0.99f, rel);

which means atk and rel are never being set correctly.

Cannot export UnityGetAudioEffectDefinitions symbol when set fvisibility=hidden

Problem:
We are shipping commercial audio plugin and we would like to hide symbols of internal components. However, the UNITY_AUDIODSP_EXPORT_API macro does not force visibility so we ended up hiding UnityGetAudioEffectDefinitions symbol as well, resulting in Unity can't find our audio plugin on android.

To reproduce:

  1. Download AudioPluginInterface.h
  2. Make some simple audio plugin (maybe a gain knob?)
  3. Using Cmake, compile it as a android .so with following flags: -fvisibility=hidden -fvisibility-inlines-hidden
  4. In Unity, build an Android game using your audio plugin, and install it on your android device
  5. Open up Android logcat on PC/Mac, and record out-comming log
  6. Run your game on Android device, you should experience that the audio plugin you made didn't do anything
  7. Stop Android Logcat, search for your plugin name in the recorded log, you should be able to find errors saying your plugin could not be found.

Proposed fix:
Inside AudioPluginInterface.h, change

#if PLATFORM_WIN
#define UNITY_AUDIODSP_EXPORT_API __declspec(dllexport)
#else
#define UNITY_AUDIODSP_EXPORT_API
#endif

to this:

#if PLATFORM_WIN
#define UNITY_AUDIODSP_EXPORT_API __declspec(dllexport)
#else
#define UNITY_AUDIODSP_EXPORT_API attribute((visibility("default")))
#endif

Hope this got fixed soon.

build log - fail " Unit test 'Accuracy' failed for expression 'err < errtol'."

  • Problem

    • Build - fail log
  • Env

    • Unity (2021.3.3f1) - windwos build
  • Build Log - Fail

C:\Users\user01\Desktop\$AS\audiostream_development\AudioPlugin\AudioPluginUtil.cpp(491): Unit test 'Accuracy' failed for expression 'err < errtol'.
C:\Users\user01\Desktop\$AS\audiostream_development\AudioPlugin\AudioPluginUtil.cpp(488): Unit test 'Accuracy' failed for expression 'err < errtol'.

Use this in Android

I want to use these effects on Android, but this can be used only on the computer!

BUG: Custom GUIs won't update once a parameter has been changed

Summary

With two or more plug-in instances active in an AudioMixer (e.g. in two Groups), the Custom GUI won't reflect the plug-in parameter's state after a parameter has been set via the Custom GUI's script. It only shows the last set value independent of the plug-in instance.

In code words:

after calling

plugin.SetFloatParameter("parameterName", value);

in IAudioEffectPluginGUI's OnGUI(IAudioEffectPlugin plugin) method,

plugin.GetFloatParameter("parameterName", out float value);

always returns the value which was set most recently, independent on which plugin instance is currently selected.

Steps to reproduce

  • Clone / download the latest version of this repository
  • build the project in NativeCode
  • create a new Unity project
  • import the binary (e.g. AudioPluginDemo.bundle on macOS) into the projects (assets)
  • also import EqualizerCustomGUI.cs, GUIHelpers.cs, MathHelpers.cs from GUICode/AudioPluginDemoGUI
  • create an AudioMixer
  • create a new Group
  • add the Demo Equalizer plugin in both groups (Master and the new one)
  • move the sliders of LowFreq, MidFreq, and HighFreq in one of the instances (only sliders, NOT the editor)
  • switch back and forth between both plugins and verify that the state updates accordingly
  • move one of the vertical bars (black, grey, white) of one instances, see how the corresponding frequency slider changes (expected behaviour)
  • again: switch back and forth between the plugins, see that the rendered GUI won't update any more although the Horizontal Sliders do

I don't think this is a bug of this repository, but rather one in Unity itself. Or is there something you can do in the scripts to prevent this from happening?

This behaviour renders the CustomGUI feature unusable if the GUI is used to change parameter values and not only displays them (like in all the UI examples in this repository).

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.