Placeholder-Software / Dissonance

Unity Voice Chat Asset
69 stars 5 forks source link

AEC Functionality Without Networking #255

Closed jlognn closed 1 year ago

jlognn commented 1 year ago

I am creating a game that requires microphone input as a key part of the game logic while playing audio from a seperate Audio Source - kind of like Guitar Hero but using the microphone to detect notes. I purchased Dissonance as the AEC functionality seemed to do what was required, but I am struggling to just get basic AEC working on a mixer that accepts one audio source (for game sounds) and another (for the microphone).

I have implemented the microphone as described in the docs, through using a Dissonance Comms object and creating a playback prefab, however the AEC filter is stating that there is no microphone preprocessor running.

My feeling here is that because I am not using any networking, which is suggested by the Dissonance Comms script complaining about the lack of a networking component, that the AEC will not run without it?

Can someone confirm that this is the case? And if so, is there a workaround to simply apply AEC without networking?

Hope someone can help!

martindevans commented 1 year ago

You're definitely right that the problem here is the lack of networking. Dissonance doesn't do any work unless it needs to, so the entire recording/playback pipeline is not started until the network system says it's connected.

To work around this you can create a custom network integration which basically just fakes being online, which forces Dissonance to startup the audio pipelines. This is actually something I've had internally for a while for testing and we've thought about releasing as part of the package a few times. Here's a version of this, which we will probably release in the next version of Dissonance:

Offline.zip

Place this into the integrations folder (Assets/Dissonance/Integrations/Offline). With the current version of Dissonance it will produce an error, to fix this replace internal with public in Assets\Plugins\Dissonance\Core\Channel\RemoteChannel.cs. See the readme for details on how to use it.

jlognn commented 1 year ago

Great stuff @martindevans - works great and can access the AEC filter now with no need for networking. Definitely +1 for including this in the next release, or even creating a new lighter asset for the store for AEC only, as I would assume that there are also other people struggling with AEC in Unity and creating similar things to me. I for one would pay for that.

martindevans commented 1 year ago

Dissonance 8.2.0 is now live on the asset store with the new OfflineCommsNetwork included in the main package.