Hi,
I was wondering if the audio engine in unity would be capable of properly mixing house/techno (cutting frequency, analyzing bpms/keys, launching and crossfading/audio accurately tracks together). If not would I be able to integrate an external library in such as Essentia (http://essentia.upf.edu/)? I know that’s what was used in Crypt of the NecroDancer and I was very impressed with what the developers did with it. I’ve been a programmer/dj/audio producer for a while now and I’m interested in seeing if I can combine those skills to make my first game.
Thanks!
You do have AudioSource.GetSpectrumData in order to do frequency-based analysis, but it’s not reliable for really accurate synchronization since you’re dealing with realtime audio from another thread, and don’t have the absolute reference point you need. If you need to do this in realtime, you should probably create an AudioFilter (look into OnAudioFilterRead), but you’ll have to find/write the code to analyze the audio yourself. If it’s okay to calculate the information prior to playing, you can get the data you need directly from the clip using AudioClip.GetData. Same deal though, you’ll need to provide your own code to analyze it.
I’ve never used external plugins, but I see no reason why it should be a problem to integrate ESSENTIA. Seems like a cool library actually. Also, they describe it as a collection of algorithms rather than a framework, so maybe they aren’t actually that hard to port to C#?