Avatar sound
How can I turn down the volume of an avatar and implement it with an slider to do so.
2 Replies
Hi @fgamez1020. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To adjust the volume of an avatar's voice in NormalVR and implement it with a slider, you can utilize the
RealtimeAvatarVoice
component. Here's how you can approach this:
1. The RealtimeAvatarVoice
component is responsible for handling voice chat in NormalVR avatars Documentation > Realtime > Xr > Voice Chat (https://normcore.io/documentation/realtime/xr/voicechat).
2. While there isn't a built-in volume control property for individual avatars, you can adjust the volume of the AudioSource
component that RealtimeAvatarVoice
uses for playback.
3. To implement this with a slider, you'll need to create a custom script. Here's an example of how you might structure this script:
4. Attach this script to a game object in your scene, and in the Unity Inspector, assign the RealtimeAvatarVoice
component of the avatar you want to control and the UI Slider you've created.
5. The slider should now control the volume of the avatar's voice.
Remember that RealtimeAvatarVoice
creates an AudioSource
component automatically if one doesn't exist, but you can also create one manually for more control over audio settings Documentation > Realtime > Xr > Voice Chat (https://normcore.io/documentation/realtime/xr/voicechat).
Note that this solution adjusts the playback volume locally. If you need to implement network-synchronized volume control, you would need to create a custom RealtimeComponent
to synchronize the volume setting across all clients. For more information on synchronizing custom data, refer to the Synchronizing Custom Data (https://normcore.io/documentation/realtime/synchronizing-custom-data#faq) documentation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@1053407831916822528> Kapa.ai is still learning and improving, please let me know how I did by reacting below.