Table of Contents Previous Directory Summary Directory Viewpoint Slideshow Javadoc for translated java source Next Directory Summary X3D Resources

X3D Example Archives: Conformance Nist, Sounds, Audio Clip

 

AudioClip provides audio data used by parent Sound nodes.

X3D Tooltips of interest: AudioClip, MovieTexture, Sound.

X3D Specification sections of interest: 16 Sound component, 16.4.1 AudioClip, 18.4.2 MovieTexture, 16.4.2 Sound.

X3D Examples Archives of related interest:

 
  19 X3D Models       X3D Model Descriptions
default_audioclip default audioclip By simply setting a default AudioClip using the default values a sound should NOT play at load time, and will not generate events.
default_looptrue default looptrue Test loop equals true. By simply setting a default AudioClip node loop field to true, and using the default values for all other fields, a sound should play at load time and loop continuously. should immediately begin, and play continuously.
description description This file tests the ability of a browser to parse the AudioClip node, and its description field. Because the AudioClip node does not affect the loaded world's Sounds or behavior, this test simply examines the browser's ability to read the AudioClip node, parse the description field, and execute the loaded world properly. The viewer should hear a constantly repeating chime sound when the world is loaded.
duration duration Test duration_changed field. A world file with an AudioClip node is loaded, and the duration_changed field for for that AudioClip is displayed as Text at the top of the world. Clicking on the "phonograph" geometry with the pointing device loads a different URL, with a different sound file. The result should be, the Text should change from "duration_changed = 5" to "duration_changed = 10" when the geometry is clicked.
isactive isactive A "phonograph" geometry is initially "white" in color, AudioClip begins to play, (when the viewer clicks on the "Start" button, the AudioClips "isActive" field changes to "true", and the color of the "phonograph" geometry should turn yellow. When the "isActive" field turns to false (when the viewer clicks the "Stop" button), the geometry should again return to a white color.
multi_url multi url This file tests the ability of a browser to skip a nonexistent URL and proceed to the next url in the list to load a sound file. The first url in this AudioClip node points to a nonexistent file. The browser should skip this url when the file cannot be opened, and proceed to the next url. As a result, clicking on the left (Single URL) button, the viewer should hear the sound of a chime for 5 seconds. Clicking on the right (Multi URL) button should also result in a 5 second chime sound.
pitchrange pitchrange This world tests an AudioClip pitch range of 0.5, 1 and 2.0 to determine if the browser correctly alters sound octave as well as sound duration time. Three AudioClip node, each with a different "pitch" value are in this world. Each can be selected by the viewer clicking on the appropriate button at the top of the world. Clicking on "Pitch 0.5" should produce a chime sound that lasts 10 seconds, and is one octave lower than that of "Pitch 1". Selecting "Pitch 1" (the default pitch) should produce a chime sound that lasts 5 seconds, and is one octave higher than "Pitch 0.5". Selecting "Pitch 2" should produce a chime sound that is one octave higher than the default (1), and has a duration of 2.5 seconds.
starteqstoploopfalse starteqstoploopfalse Test loop field set to false, and the startTime is equal to stopTime. The result shoud be stopTime will be ignored, but because loop is false, the sound will play only once. Clicking on either "Start" or "Stop" button automatically sets both to the same value of "now", and the chime sound should play one 5 second cycle, then stop. If the "Stop" button (setting stopTime = now) is pressed any time during play, the sound should stop instantly.
starteqstoploopfalse_past starteqstoploopfalse past Test of loop field set to false, and the startTime "4" equal to stopTime of "2". Result should be that stopTime is ignored. However, because loop is false, the sound should not play when the world is loaded.
starteqstoplooptrue starteqstoplooptrue Test of loop field equal to true, and startTime equal to stopTime. This should result in stopTime being ignored, and a continuous play loop. Clicking on the "Start" button sets startTime = "now", as well as simultaneously setting stopTime = "now". As a result, stopTime is ignored, and a continuous loop of the "chime" sound should result. If the "Stop" button (setting stopTime = now) is pressed any time during play, the sound should stop instantly.
starteqstoplooptrue_past starteqstoplooptrue past Test of loop field equals true, and startTime of "4" equal to a stopTime of "4". This should result in stopTime being ignored, and a continuous play loop. As a result, the "chime" sound should automatically begin to play when the world is loaded, and repeat continuously.
startgtstoploopfalse startgtstoploopfalse Test of looop set to false, and the startTime (clicking the "Start" button) is greater than stopTime (set to 4 in this example). The chime sound should play once only, then stop.If the "Stop" button is pressed any time before the sound completes its cycle, the sound should stop instantly.
startgtstoploopfalse_past startgtstoploopfalse past Test of loop equal to false, and the startTime "4" greater than a stopTime of "2". The result should be that stopTime is ignored. However, because loop is false, the sound should not play when the world is loaded.
startgtstoplooptrue startgtstoplooptrue Test of loop equal to true, and startTime greater than stopTime. This should result in stopTime being ignored, and a continuous play loop. Clicking on the "Start" button sets startTime = "now", which is greater than a stopTime value of "4". As a result, a continuous loop of the "chime" sound should result. If the "Stop" button (setting stopTime = now) is pressed any time during play, the sound should stop instantly.
startgtstoplooptrue_past startgtstoplooptrue past Test of loop equal to true, and startTime of "4" greater than a stopTime of "2". This results in stopTime being ignored, and a continuous play loop. As a result, the "chime" sound should automatically begin to play when the world is loaded, and repeat continuously.
startltstoploopfalse startltstoploopfalse Test of loop equal to false, and startTime less than stopTime. The result should be the chime sound will play until stopTime is reached. Clicking on the "Start" button sets startTime to "now". Simultaneously, stopTime is set to ("now" + 12 seconds). As a result, because loop is set to false, the sound will cycle for only ONE complete loop (a total of 5 seconds), then stop. If the "Stop" button is pressed any time before the end of the sound cycle, the sound should stop instantly.
startltstoploopfalse_past startltstoploopfalse past Test of loop equals false, and the startTime "2" less than stopTime "4". The sound will not play because the stopTime of "4" is before "now".
startltstoplooptrue startltstoplooptrue Test of loop equals true, and the startTime less than stopTime. The chime sound will play until stopTime is reached. Clicking on the "Start" button sets startTime to "now". Simultaneously, stopTime is set to ("now" + 12 seconds). As a result, the sound will cycle for 2 complete loops (a total of 10 seconds), then setop 2 seconds into the third loop. If the "Stop" button is pressed any time before stopTime is reached, the sound should stop instantly.
startltstoplooptrue_past startltstoplooptrue past Test of loop equals true, and startTime of "2" less than a stopTime of "4" This results in stopTime being considered less than "now", and hence the AudioClip will not play. As a result, the "chime" sound should NOT automatically begin to play when the world is loaded, and repeat continuously.

Online at https://www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip

Validate XHTML 1.1

Master source-code model archive is under subversion control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/ConformanceNist/Sounds/AudioClip

The X3D Resources: Examples page and Savage Developers Guide provide more information about the production of this archive.

Table of Contents Previous Directory Summary Directory Viewpoint Slideshow Javadoc for translated java source Next Directory Summary X3D Resources