
Home > Archive > Developers/reference > API Reference > 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.
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 action | Description |
---|---|
mousein | Cursor points at a node |
mouseout | Cursor leaves a node |
hover | Cursor remains on a node |
click | User click or activates a node, typically a short sound |
refocus | Sound while the scene is re-arranging to focus on clicked node |
drag | User drags the stage to spin or pan the nodes |
home | User clicks nav bar to go home |
backward | User clicks nav bar to go backward to previous'y focused node |
forward | User 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 action | Description |
---|---|
contract | User exits “expanded” view |
expand | User enters “expanded” view |
search | User initiates search, and waits for reply |
select | User selects a search hit |
zoomin | User zooms in using a click (not drag on zoom slider) |
zoomout | User zooms out (not drag on zoom slider) |
activate1 | Optional sound used by some skins when “activating” part of the UI. |
deactivate1 | Optional sound used by some skins when “deactivating” part of the UI. |
activate2 | Optional 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
Attribute | Description |
---|---|
label | Name of the sound family |
base | Path 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
Attribute | Description |
---|---|
action | Action for this sound, the action is one of the actions listed above (string) |
src | File name (string) |
lowsrc | File 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” |
repeat | Number of times the sound loops. 0=infinite. Default is “1”. (integer) |
volume | Volume 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>
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.