Skip to content

How do I add sounds to my scene? #256

Answered by jbaicoianu
jbaicoianu asked this question in FAQs
Discussion options

You must be logged in to vote

Sounds can be added to your scene using the <sound> tag. If a <sound> tag has a pos attribute specified, then the sound will be spatialized, and will sound like it is emitting from the specified location. If the pos attribute is omitted, the sound will be "head locked". New sound assets can be defined by adding an <AssetSound> tag to your <assets> section. For example:

<janus-viewer>
  <assets>
    <assetsound id="music" src="music.mp3" />
    <assetsound id="birds" src="tweets.mp3" />
  </assets>
  <room>
    <sound id="music" />
    <sound id="birds" pos="1.2 2 -4.9" />
  </room>
</janus-viewer>

Replies: 1 comment

Comment options

jbaicoianu
Apr 7, 2023
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by jbaicoianu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
FAQs
Labels
None yet
1 participant