Transmitting your voice to the network
Transmitting our voice to the multiplayer server of our metaverse is really easy with Photon. The SDK has ready-to-use components that will make all the hard work easier.
To start, we need to find the Prefab we’ve used for our character. Find the PlayerInstance Prefab, which is located in the Assets | _App | Photon | PhotonUnityNetworking | Resources path, and double-click to edit it.
With the PlayerInstance Prefab in Edit Mode, we will follow these steps to add voice functionality:
- Select the PlayerArmature GameObject and display its Inspector panel.
- Add a new component called Audio Source.
- Add another component, called Photon Voice View.
- We will also need another component, called Recorder.
- Finally, add the Speaker component.
Great, now the Inspector panel of the PlayerArmature GameObject will look as in the following screenshot:
Figure 10.15 – PlayerArmature Inspector...