LASP is a Unity plugin providing low-latency, high-performance and easy-to-use audio input functionality that is useful for creating audio reactive visuals.
- Low latency (less than 16 ms) audio input.
- High performance audio analysis (peak level detection, RMS calculation) with C++ native code.
- Three band (low, middle, high) filter bank useful for detecting rhythmic accents.
- Supports Windows (WASAPI), macOS & iOS (Core Audio) and Linux (ALSA).
- Unity 2017.1 or later
At the moment, LASP supports Windows, macOS, iOS and Linux.
Download one of the unitypackage files from the Releases page and import it to a project.
All the public methods of LASP are implemented in AudioInput
as static
class methods that can be called without any setup. Each of these methods has a
FilterType
argument and returns filtered results based on the argument (or
just returns non-filtered results with FilterType.Bypass
).
GetPeakLevel
returns the peak level of the audio signal during the last
frame. GetPeakLevelDecibel
returns the peak level in dBFS.
AudioInput
automatically caches the results, so that these methods can be
called multiple times without wasting CPU time.
CalculateRMS
calculates and returns the RMS (root mean square) of the audio
signal level during the last frame. CalculateRMSDecibel
returns the RMS in
dBFS.
AudioInput
automatically caches the results, so that these methods can be
called multiple times without wasting CPU time.
RetrieveWaveform
copies the most recent waveform data from the internal
buffer to a given float array. The length of the array should be shorter than
the internal buffer. Less than 1024 would be good.
- LASP always tries to use the system default device for recording. There is no way to use a device that is not assigned as default.
- LASP only supports monophonic input. Only the first channel (the left channel in case of stereo input) will be enabled when using a multi-channel audio device.
LASP Loopback - A special build that supports analyzing audio output from Unity instead of external audio sources. This is useful to create audio reactive behaviors with internal audio sources.