Office Tutorial 3 - Add Ambience

Training Notes

In this article, we will once again work with scripts and resources. Additionally, we will use a media catalog to play music. If you’d like to use your own music, review this resource.

 

 

One of the most important aspects of an impactful VR experience is well-used sound. In this tutorial, we will add some office background noise as well as some localized sound to the speaker in the office.

To keep all the music organized in our scenario, we are going to create and use an "Ambience Script".

Step 1: Create an "Ambience" Script

  • Click on the Script icon.

  • Click on your script catalog.

  • Click on "Add New Script".

  • Name the script "Ambience".

  • Click on the checkmark to save the script.

  • Close the edit section by clicking the x button.

  • Click on the Ambience script to open it on your screen.

  • Collapse the script catalog by using the ">" icon.

Step 2: Add Scene Objects

If your users will be interacting with objects in the scene, you need to add those objects to the script. In this script, we are going to be adding some music playing on the office speaker, so we need to add the speaker object to the script.

As usual, we will ensure we are in the correct script by looking to see it is the active script:

  • Open the catalog drawer by clicking on the folder icon on the far right:

  • Open the "Office Scene Objects" catalog.

  • Find the "Speaker" object and drag it into the first frame of the "Ambience" script.

  • Click on the ">" icon to collapse the catalog menu.

  • Rename the frame "Scene Objects".  

  • Click outside of the text box to save the changes.

Step 3: Add Background Sound

  • Click the '+' on the main frame to create a new frame at the top level:

  • Open the Media Catalog by clicking on the media icon on the far right:

  • Navigate to the "Ambient Sound" Catalog.

  • Find the file called "Office Background".

  • Drag it into the new frame.

  • Click on the ">" icon to collapse the catalog menu.

  • Because we want this background noise to continue throughout the scenario, toggle the "loop" option to "checked".

  • Select the "Ambient" track. This means that this sound is the lowest priority if there are several sounds playing at once.

  • Save script (don’t test yet).

Before you test you need to launch this "Ambience" script from the Director Script:

  • Open the Director Script.

  • Create a new top-level frame and name it "Ambience".

  • Drag the Ambience script from the script catalog into the frame.

  • STOPSave and Test in the headset. Play the scenario now. You will notice that the background sound is playing. It is too loud. We will adjust this in the next step.

Step 4: Adjust Volume of Background Sound


In order to make the background sound quieter, use the "Volume" field on the audio resource in the frame. Volume is set from 0 to 1 with 0 being silent and 1 being maximum volume.

  • Open your Ambience script.

  • Open the "Background" Sound frame.

  • Adjust the volume until it seems right to you. In this tutorial we have set it to 0.1:

  • STOPSave and Test in the headset. The sound should now be quieter.

Step 5: Add Music to Coming from the Speaker

We want the learner to hear the music coming directly from the speaker in the scene.

  • Create another new frame in the "Ambience" script and call it "Office Music":

  • Open the Media Catalog by clicking on the media icon on the far right:

  • Navigate to the "Ambient Sound" Catalog.

  • Choose a song that you would like to be playing on the Bluetooth speaker on the desk.  In this tutorial, we chose "bensound-retrosoul.mp3".

  • Drag it into the new frame.

  • Click on the ">" icon to collapse the catalog menu.

In order to make it sound like the music is coming from the speaker, we give the sound an anchor.

  • Chose "Speaker" from the anchor dropdown on the resource:

  • You may also want to loop the track so that it plays continuously.

  • You might also want to adjust the volume once you've tested it.

  • Save the script (don’t test yet).

Step 6:  Add Ambience Script to Director Script

The Ambience script will not run until we add it to our Director Script.

  • Open the Director Script.

  • Add a new top-level frame.

  • Re-name the frame "Ambience".

  • Drag the Ambience script into the frame.

  • STOPSave and Test in the headset. You should now hear the ambient background noise and the sound coming from the speaker in the office.

Challenge: instead of looping the speaker music, you could create a playlist that starts the next song when the previous one has finished playing. You could use subframes and object event conditions to play a new song when the last one finishes or "closes". Try to cue up a few songs using this pattern.

The music files used in the tutorial are from Bensound: Music for Video Creators - Hear the Difference . They are free to use for non-commercial purposes when attribution is given. If you would like to use any of the music in a commercial setting, you can license the music on the above website.

In the Headset

This is what your scenario will look like so far:

Training Notes

Key Takeaways from Tutorial 3

  • If your users will be interacting with objects in the scene, you need to add those objects to the script.  To keep it organized, we suggest a frame called "Scene Objects".

  • All objects come from the Catalogs, so those must be populated first. This is the same for music, sounds, images, and more.

  • Any music on the Ambient track has the lowest priority if there are several sounds playing at once. 


Next Up: Office Tutorial 4 - Add a Character