Documentation
Set up the PRO Unity SDK in minutes. Follow the steps below and you can add screenshots later where noted.
Generate API Key.Window > Package Manager.+ button and select Add package from git URL....Add.Git URL
https://github.com/basedappsandgames/pro-unity.gitSamples tab and import the examples.PROManager (or drag the PROManager prefab from Packages > PRO > PROManager).PROManager component to the GameObject.PROConfig component to the same GameObject.PROConfig, assign the PROManager reference to its slot.PROManager named RecordingSource.IRecordingSource component to RecordingSource.PROConfig, assign the RecordingSource object to its slot.PROConfig component.Configure your set up just how you want it.
CustomPROConfig.csPROConfig component and copy paste it as a base into your custom component.using Wildwest.Pro; to your component. If you cannot find it, you need to add the Wildwest.Pro ASMDEF to your project's asmdefs.PROConfig component with your custom component in the PROManager GameObject. Re-hook everything up.GetUserId() to return a unique ID for the player, such as their Meta User ID (112119046 eg). This defaults to an auto-generated ID per player device.GetRoomId() to return the room ID. For Normcore, this could be Realtime.instances.First.room.name. This defaults to your game name.CanRecord() based on your preferences. We suggest checking if a player is connected to a room and that room has 2+ people. For VR projects, we recommend using OVRManager to check if the player is in headset. You can also return false if the player has a high reputation score.OnData() to handle moderation results when they come back to Unity client from the backend. Useful for local temp muting or sending info to your backend.Request Actions, Request Transcription, Request Safety Scores etc.Run your first test
Debug checkbox in the PROConfig in the inspector to test in Editor.[PRO] PROManager: Started receiving audio data, as well as a log from the RecordingSource.Request Transcription if you want to see the transcription logged.Congrats! You have successfully set up PRO to keep your community safe.
Configure audio chunking.
AudioChunkerBehaviour component called Chunker.PROManager prefab comes with a DefaultAudioChunkerBehaviour on it that works out of the box.AudioChunkerBehaviour, add the component to your PROManager gameobject, and drag the component into the AudioChunker slot in the PROManager inspector.Encode, you can copy the DefaultAudioChunkerBehaviour Encode which uses PROAudioUtil to downsample and encode to 16kHz mono WAV.The project includes a few built-in recording sources, and more are available via samples.
PROManager.ConfigureChunker in the Initialize method of the RecordingSource with the sample rate and channel count. Otherwise you will not send the correct chunks of audio to the PRO API.