How to use the NatDevice plugin to implement iOS echo cancellation in Unity.
Prerequisites
-
Unity 2020.3+
-
NatML cloud access key (https://docs.natml.ai/unity/#get-natml)
Instructions
-
Add the following items to your Unity project's Packages/manifest.json
{
"scopedRegistries": [
{
"name": "NatML",
"url": "https://registry.npmjs.com",
"scopes": ["ai.natml"]
}
],
"dependencies": {
"ai.natml.natdevice": "1.2.2"
}
}
- Copy your access key and add it to your Project Settings:
- Copy NatDeviceAudioSource.cs from the liveswitch demo project located at Assets/Scripts/Channel
- Change the CreateAudioSource method in LocalMedia.cs to return NatDeviceAudioSource instead of AudioClipSource
protected override AudioSource CreateAudioSource(AudioConfig config)
{
return new NatDeviceAudioSource(config);
}
Please reach out to support@liveswitch.com if you would like us to provide you with a sample app to get you started.