**Problem: **when using LibPD4Unity, it seems that you can only send the mixed audio signal from Unity to Pure Data. This is because all the sending is done by LibPdFilterRead.cs in it's OnAudioFilterRead method and it seems that you can only have one instance of that script that it recommended to be placed on the AudioListener. This means that inside Pure Data, there is no way of differentiating the sources from one another.
Reasons to want to send the audio from Unity to Pure Data instead of just reading sound files inside Pure Data:
-To use the Unity's 2D/3D sound positioning system.
-LibPD has many incompatibilities with extended objects or Unity, so it is much less of a hassle if Unity can deal with reading all the different sound files with all their extensions,
-Unity compresses the audio files bases on build settings and can be platform specific.
-Using other Unity audio processing modules (the mixer is coming soon).
-Other reasons I'm not thinking about right now.
**Partial Solution: **I've been doing some research on the subject and I have almost found the solution. All that is needed is a script which implements the OnAudioFilterRead function and to put that script on an object with an AudioSource. Then you would use LibPd.SendList(nameOfReceiver, data) to send the list of float representing the current audio block. Then in Pure Data, you would set up a [receive nameOfReceiver] and use one of zexy's object, [unpack~] which converts a list of float into a signal Et voilà!
But, there is a catch... the objects [unpack~] and [pack~] (that does the opposite) are not compatible with libPd and/or Unity.
I have hacked a way to do it anyway by writing the list of float to an array and then reading the array with a [tabread~] but the process much too CPU intensive for what it does.
**Question: **Does anyone know a way to make [pack~] and [unpack~] objects compatible with LibPd4Unity and/or can think of an alternative solution to this problem? Pure Data has a huge potential in games, but it needs that flexibility to flourish.
Any help will be appreciated.