How to control Voice Volume?

I have read the questions related to the Normcore volume control. According to the answers, I found the prefab with the RealtimeAvatarVoice script, which is the CustomMetaAvatar prefab (which can be created from the MetaAvatar script). According to the answer, since the RealtimeAvatarVoice creates the AudioSource at runtime, the AudioSource should be created under the Head object of the CustomMetaAvatar to which the RealtimeAvatarVoice is attached. However, when querying in runtime via the Update method, the AudioSource is not found. Since there is no AudioSource, I cannot adjust the volume. What should I do?
3 Replies
kapa.ai
kapa.ai3d ago
Hi @Overay-seongmin. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information in the knowledge sources, I can help you with controlling voice volume in Normcore. According to the documentation, RealtimeAvatarVoice will create an AudioSource component at runtime if one is not already present. However, if you'd like to configure the AudioSource in the editor (including volume settings), you should add your own AudioSource component to the same GameObject that has the RealtimeAvatarVoice component, and RealtimeAvatarVoice will detect and use that instance instead. From the documentation:
RealtimeAvatarVoice plays audio back using Unity's audio engine so all of the Unity audio APIs work correctly. At runtime, RealtimeAvatarVoice will create an AudioSource if one is not present, but if you'd like to configure it in the editor, add your own AudioSource component and RealtimeAvatarVoice will detect and use that instance.
Documentation And similarly:
By default RealtimeAvatarVoice will create an AudioSource component, however, if you would like to set custom spatialization settings, create an AudioSource manually. RealtimeAvatarVoice will detect and use this instance instead.
XR Voice Chat To solve your issue: 1. Add an AudioSource component directly to the same GameObject that has the RealtimeAvatarVoice component (likely on the Head object of your CustomMetaAvatar prefab) 2. Configure the volume and other settings on this AudioSource in the editor 3. When your application runs, RealtimeAvatarVoice should detect and use your pre-configured AudioSource instead of creating its own This way, you'll be able to control the voice volume through the AudioSource component you've added manually. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3d ago
<@840905813887025173> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Mechabit
Mechabit3d ago
add an audiosource to the prefab, it will then use the one you created and you can change the volume and effects etc.

Did you find this page helpful?