Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Sound Node

Anonymous

Sound Node

Anonymous
Not applicable

How do you import a sound file into the Node Editor?  I don't see a browser and drag and drop doesn't work.

0 Likes
Reply
3,105 Views
18 Replies
Replies (18)

dlincol1
Advocate
Advocate

From the Scenegraph menu select Create, Sound.

 

Then edit the Sound node and change the soundFile attribute to be the path to your wav file.

 

To play it from a Variant Set:

Add this Python code to the Script Tab.

 

s = findNode("Sound")
s.setFieldBool("play", true) 

Regards,
Dan
0 Likes

Anonymous
Not applicable

Thanks for the information.  Can you walk me through all the steps?  I created the sound node in the SG.  Do you drag and drop a .wav file on top of it?  I did this and the Import Options window pops up.  I say "ok", and something happens, but I'm not sure if it is truely loaded- nothing happens when I click on the sound node.  Then do I create an new Variant or can I add it to an existing one?  Say, when I click on Material Variant to change the paint color, I want to hear a sound.  Do I copy and paste the script into the Script Variant and need to change part of it to the name of the .wav file?  Thanks so much.

0 Likes

sinje_thiedemann
Autodesk
Autodesk

Hi, dropping the wav file onto VRED doesn't work. You need to set the path of the .wav file in the Node Editor, see attached screenshot.

Regards

Sinje

0 Likes

dlincol1
Advocate
Advocate

Dawn,

 

You can add the Python script to the same Variant Set (Script) Tab.

You may need to set the loop attribute to false to keep it from looping.

 

Regards,

Dan

Regards,
Dan
0 Likes

Anonymous
Not applicable

Thanks for your replies.  I did what you said, but I'm still not hearing anything.  I must be missing a step.

0 Likes

sinje_thiedemann
Autodesk
Autodesk

Do you hear something when you load the example file 3DSound.py?

 

I noticed that it's a bit tricky to enter the path in the Node Editor. You need to enter it without quotes. With every character that you're typing VRED tries to load the file, that's why there are lots of error messages in the Terminal as long as the path is not complete.

0 Likes

Anonymous
Not applicable

I'm trying out the same and nothing works. 3DSound and 3DSound2 don't play anything, making a sound node and pointing it to a wav file fails too. It doesn't error out when I finish writing the path, but it won't play either. 

0 Likes

Anonymous
Not applicable

A tutorial would be nice.  Anyone?

0 Likes

Anonymous
Not applicable

I see this topic mentioned in the May Knowledge Network:

http://knowledge.autodesk.com/support/vred-products/troubleshooting/caas/sfdcarticles/sfdcarticles/H...

 

Issue:

How to control sound within Autodesk® VRED™

Solution:

There are some example scenes available within the installation folder of VRED under examples that are explaining how a sound file can be handled.

 

I see some .wav files in the examples folder, but I do not see the scene example containing any sound nodes.

0 Likes

sinje_thiedemann
Autodesk
Autodesk

The examples are 3DSound.py and 3DSound2.py.

0 Likes

Anonymous
Not applicable

While these examples work, I can't seem to make it work with any other wav files other than the supplied. What are the constrains of the sound types? 

 

I load 3Dsound2.py, it plays the motor_b8 file. I copy a random wav to the same folder the motor_b8.wav is at, re-point the soundFile field to it, then it won't play anymore (even after ckicking pay = true field on and off repeatedly). If I point the node to the motor_b8.wav again, it won't play either. I re-open 3dsound2.py and it won't work anymore. I need to re-start vred for the example to work again.

 

If I point the soundFile to any other wav file that comes with vred, it works. Looks like other wav files are breaking vred?

0 Likes

Anonymous
Not applicable
Heads up, I think I figured this one out...

When you point to a new sound, do NOT use "", paste the whole path. The sound might not play. Save the file with play ON, then close and re-open VRED, it should now work.

Anonymous
Not applicable

I'm glad you've made some progress, pselener.  I'm trying so hard to get this, but I have no Python/scripting experience, so I'm missing the basics.

 

I did figure out how to turn the sound on and off, using Variants, but when I save the scene and re-open it , the Variants disappear. 

 

When I open "3DSound", I hear the .wav file, "drumloop", even though I see the word, "motor_a8.wav".

 

I would expect it to play once instead of over and over if I make "loop" false in the Node Editor, but it doesn't.

 

I'm confused about what the cube geometry is for.

 

For the "3DSound2" file, I don't hear anything.  I'm not sure what to do with this one.  Are you supposed to Add it to a .vpb scene?

0 Likes

Anonymous
Not applicable
You don't need variants to turn the sound on and off, you can do it from the node editor. I don't know why your vsets would disapear...

The cube geometries I think are supposed to show where the two different sounds are coming from.
0 Likes

bryan_shepperd
Explorer
Explorer

Playing with the examples and by changing my wav file I find that sound works upon scene reload.  It seems to have to load the .wav in at scene start or it doesn't load it at all.  I'm looking at attributes of the sound node in the node editor and the gain does not seem to work.  pitch does work.  reference distance and rolloffFactor do control how loud a sound is relative to how far you are from it.  I have no idea what cone angles do - they do not appear to do anything. Seems odd there is a boolean play and a boolean stop.  play true false seems to work just fine.  Perhaps play false functions as a pause and a full stop would bring you to the beginning.  Could make sense but I have not checked yet.

 

I wish there were more python documentation for anything related to this.

 

In the demo scene the sound under the red cube has no rolloff factor and the sound on the green cube does have rolloff. So the cubes are there only to indicate where the sounds are coming from.  moving closer to the green cube you should hear more engine noise. 

0 Likes

Anonymous
Not applicable

Thank you guys for your guide, sounds perfectly working..

 

(vred pro 2018)

 

Regards

0 Likes

Anonymous
Not applicable

Hello Guys

 

I just would like to ask you guys, can i volume up or down individually to sound nodes in node editor ?

 

I tried many section there but i failed..

 

Thank you and Regards

0 Likes

Anonymous
Not applicable

By the way according to my attempts, i get success with only 44100.0 Hz and 16 bit wav files !

And they have to be stand in the `root`, if you would like to make them all in one group its also doesnt work.

Your attentions..

 

Regards

 

0 Likes