Home

Documentation

Getting Started

Set up the PRO Unity SDK in minutes. Follow the steps below and you can add screenshots later where noted.

Get your API Key

  1. Create a PROject in the dashboard.
  2. Go to Keys and click Generate API Key.
  3. Copy the API Key.
  4. ⚠️Important: Copy your API Key now — it only shows once. Store it safely.

Unity SDK Installation

  1. Open the Unity Editor and go to Window > Package Manager.
  2. Click the + button and select Add package from git URL....
  3. Paste the following Git URL and click Add.

    Git URL

    https://github.com/basedappsandgames/pro-unity.git
  4. Wait for the package to install.
  5. (Optional) In Package Manager, open the Samples tab and import the examples.
Tip: After installation, you can close the Package Manager.

Unity Setup

  1. Create an empty GameObject named PROManager (or drag the PROManager prefab from Packages > PRO > PROManager).
  2. Add the PROManager component to the GameObject.
  3. Add the PROConfig component to the same GameObject.
  4. In PROConfig, assign the PROManager reference to its slot.
  5. Create a new child GameObject under PROManager named RecordingSource.
  6. Add an IRecordingSource component to RecordingSource.
  7. In PROConfig, assign the RecordingSource object to its slot.
  8. Type your API Key in the PROConfig component.

PRO Config

Configure your set up just how you want it.

  1. Create a script in your project named CustomPROConfig.cs
  2. Open up the PROConfig component and copy paste it as a base into your custom component.
  3. You may have to add using Wildwest.Pro; to your component. If you cannot find it, you need to add the Wildwest.Pro ASMDEF to your project's asmdefs.
  4. Replace the PROConfig component with your custom component in the PROManager GameObject. Re-hook everything up.
  5. Set your 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.
  6. Set your GetRoomId() to return the room ID. For Normcore, this could be Realtime.instances.First.room.name. This defaults to your game name.
  7. Configure 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.
  8. Set up 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.
  9. Check which fields you want to receive from the backend, such as Request Actions, Request Transcription, Request Safety Scores etc.

Testing

Run your first test

  1. Check the Debug checkbox in the PROConfig in the inspector to test in Editor.
  2. Press Play
  3. You should see [PRO] PROManager: Started receiving audio data, as well as a log from the RecordingSource.
  4. Speak into your microphone (or put on your headset and speak). If the audio is unsafe, you will see the results logged in the console and show up in the web portal. Make sure to check Request Transcription if you want to see the transcription logged.

Congrats! You have successfully set up PRO to keep your community safe.

Audio Chunker

Configure audio chunking.

  1. PROManager takes in a AudioChunkerBehaviour component called Chunker.
  2. The PROManager prefab comes with a DefaultAudioChunkerBehaviour on it that works out of the box.
  3. If you want to customize the chunking, you can create a new MonoBehaviour that inherits from AudioChunkerBehaviour, add the component to your PROManager gameobject, and drag the component into the AudioChunker slot in the PROManager inspector.
  4. The AudioChunkerBehaviour must have a Configure method that takes in chunk duration seconds, sample rate, and channel count. It uses this to calculate the number of samples per chunk to send up to the PRO API.
  5. Configure is called by PROManager.ConfigureChunker, which must be called by a RecordingSource based on its sample rate and channel count.
  6. The custom AudioChunkerBehaviour also needs to implement Encode, you can copy the DefaultAudioChunkerBehaviour Encode which uses PROAudioUtil to downsample and encode to 16kHz mono WAV.

Recording Sources

The project includes a few built-in recording sources, and more are available via samples.

⚠️Important: You must call 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.

Next steps