Hi!
I’m new to unity and I’m trying to make an native audio plugin work with unity.
I’ve made an audio source in my project and I’ve added my component script that gets the generated audio data from the plugin. Now I want to play this audio data using the audio source which the script is attached to.
How do I do this? Do I use audioclip for this?
The game engine I used before was discontinued on a very short notice so I’m trying to move my game project to unity.
Hi Hoogin, which native audio plugin are you using? If you haven’t already, check out the documentation for Unity 5’s AudioMixer. Native audio plugins exist on AudioMixer Groups (aka Tracks/Channels).
If you are using a C# based plugin, they typically use OnAudioFilterRead() to pass the audio data back to the audio engine.
The plugin is one I’m making to interface a C library to generate sound effects.
I checked out the documentation on the AudioMixer, should I use the mixer to play my generated sound effects?
Route an empty audio source through the mixer and apply the sound effect there?
I’m looking at the Unity Native Audio Plugin SDK right now.