Share |

Home > Archive > Developers/reference > API Reference > Audio

CUSTOM AUDIO

The API is still being finalized. This is a preview...

SpicyNodes supports interactive sound effects. These sounds add a depth to the user experience, and can be customized. SpicyNodes provides approximately 20 professionally-designed sound families, ranging from subtle and professional to more playful and unusual.

Universal sounds

To use your own sounds, hosted on your server, you can create an XML file to define the sounds, and define the path to the XML file in the HTML.

The following sounds are available to all skins:

Core actionDescription
mouseinCursor points at a node
mouseoutCursor leaves a node
hoverCursor remains on a node
clickUser click or activates a node, typically a short sound
refocusSound while the scene is re-arranging to focus on clicked node
dragUser drags the stage to spin or pan the nodes
homeUser clicks nav bar to go home
backwardUser clicks nav bar to go backward to previous'y focused node
forwardUser clicks nav bar to go forward again (after having gone back)

The following sounds are sometimes available, depending on the skin and the options you choose to make available for user navigation:

Optional actionDescription
contractUser exits “expanded” view
expandUser enters “expanded” view
searchUser initiates search, and waits for reply
selectUser selects a search hit
zoominUser zooms in using a click (not drag on zoom slider)
zoomoutUser zooms out (not drag on zoom slider)
activate1Optional sound used by some skins when “activating” part of the UI.
deactivate1Optional sound used by some skins when “deactivating” part of the UI.
activate2Optional secondary sound used by some skins when “activating” part of the UI.

These sounds are defined in an XML file. The XML file begins with a tag. It has two attributes:

AttributeDescription
labelName of the sound family
basePath to the sounds directory. All sounds should be in one directory, and that directory must be at the same or deeper level than the swf.

Each sound is defined in a tag. The following are attributes:

AttributeDescription
actionAction for this sound, the action is one of the actions listed above (string)
srcFile name (string)
lowsrcFile name for optional low-bit-rate sounds which is loaded first, so that sounds can begin quickly. lowsrc sounds are loaded before the src sounds. (string)
pan“stereo” is default, and adjusts left/right sound balance to match cursor position. Other option is “mono”
repeatNumber of times the sound loops. 0=infinite. Default is “1”. (integer)
volumeVolume for this sound, relative to the others. The master volume is defined in the settings XML file. 0..1. (real number)

Here is a sample XML file:

<?xml version="1.0" encoding="UTF-8"?>
<soundset label="Sound library A" base="http://www.yoursite.com/path/to/soundLibA/">
	<sound src="backwards.mp3" pan="mono" repeat="1" action="backward" volume="0.7"/>
	<sound src="click.mp3" pan="stereo" repeat="1" action="click" volume="0.2"/>
	<sound src="contract.mp3" pan="stereo" repeat="1" action="contract" volume="0.7"/>
	<sound src="drag.mp3" pan="stereo" repeat="0" action="drag" volume="0.7"/>
	<sound src="expand.mp3" pan="stereo" repeat="1" action="expand" volume="0.7"/>
	<sound src="forward.mp3" pan="stereo" repeat="1" action="forward" volume="0.7"/>
	<sound src="home.mp3" pan="stereo" repeat="1" action="home" volume="0.7"/>
	<sound src="hover.mp3" pan="stereo" repeat="1" action="hover" volume="0.7"/>
	<sound src="mouse_in.mp3" pan="stereo" repeat="1" action="mousein" volume="0.7"/>
	<sound src="mouse_out.mp3" pan="stereo" repeat="1" action="mouseout" volume="0.7"/>
	<sound src="refocus.mp3" pan="stereo" repeat="1" action="refocus" volume="0.7"/>
	<sound src="search.mp3" pan="stereo" repeat="1" action="search" volume="0.7"/>
	<sound src="select.mp3" pan="stereo" repeat="1" action="select" volume="0.7"/>
	<sound src="zoom_in.mp3" pan="stereo" repeat="1" action="zoomin" volume="0.7"/>
	<sound src="zoom_out.mp3" pan="stereo" repeat="1" action="zoomout" volume="0.7"/>
</soundset>

A sound for each node

You can also define a sound to load for a specific node. This is described in the nodemap XML. You can define the full URL to a sound on your server using the “sound” attribute within a node tag.

Share |