Javascript must be activated for this page!
NOTE: This page is from an older version, see the latest version
here .
The Sound Interface plugin extends krpano with actions for playing and controlling sounds directly from xml.
The plugin must be loaded only once for all sounds. The sounds itself will be started / stopped / controlled by calling
the Sound Interface actions.
Note - the Sound Interface actions are not available until the plugin was loaded.
Either use the plugin onloaded event or use the
preload="true" setting to make sure that the
plugin was loaded and is ready for usage.
The plugin will automatically set keep="true" for itself,
so it is not necessary to set that!
rootpath
root path for the the sound files
relative from the xml file, default=""
it's possible to use placeholders like %SWFPATH% here
volume
the global volume for all sounds
0.0 - 1.0, default=1.0
can be dynamically changed by actions (set(), tween(), ...)
mute
set the global mute for all sounds
true or false, default=false
can be dynamically changed by actions (set(), tween(), ...)
The Sound Interface plugin add its actions directly to the krpano root.
That means the actions can be called like normal krpano actions.
preloadsound(mp3file)
preloads a sound file
this can be used to reduce the latency when starting to play
mp3file = the path and filename of a sound file
playsound(name, mp3file, loops*, oncomplete*)
plays a sound file
name = unique identification name for the sound
mp3file = the path and filename of a sound file
loops = number of loops, 0=endless, default=1
oncomplete = actions that will be called on complete
playsound2D(name, mp3file, volume*, pan*, loops*, oncomplete*)
plays a sound file with adjustable volume and panning
name = unique identification name for the sound
mp3file = the path and filename of a sound file
volume = sound volume (0.0 - 1.0, default=1.0)
pan = left/right panning (-1.0(=left) - +1.0(=right), default=0.0)
loops = number of loops, 0=endless, default=1
oncomplete = actions that will be called on complete
playsound3D(name, mp3file, ath, atv, range*, volume*, loops*, oncomplete*)
plays a directional 3D sound at a given spherical position
name = unique identification name for the sound
mp3file = the path and filename of a sound file
ath = horizontal sound source position (-180 .. 180)
atv = vertical sound source position (-90 .. +90)
range = range of the sound (in degrees, default=90)
volume = sound volume (0.0 - 1.0, default=1.0)
loops = number of loops, 0=endless, default=1
oncomplete = actions that will be called on complete
playsound3Dh(name, mp3file, ath, range*, volume*, loops*, oncomplete*)
plays a directional 3D sound at a given horizontal position
independent of the vertical looking direction
name = unique identification name for the sound
mp3file = the path and filename of a sound file
ath = horizontal sound source position (-180 .. 180)
atv = vertical sound source position (-90 .. +90)
range = range of the sound (in degrees, default=90)
volume = sound volume (0.0 - 1.0, default=1.0)
loops = number of loops, 0=endless, default=1
oncomplete = actions that will be called on complete
playsound3DHS(name, mp3file, hotspotname, range*, volume*, loops*, oncomplete*)
plays a directional 3D sound at a hotspot position
when the hotspot moves the sound will follow it
name = unique identification name for the sound
mp3file = the path and filename of a sound file
hotspotname = name of the hotspot
range = range of the sound (in degrees, default=90)
volume = sound volume (0.0 - 1.0, default=1.0)
loops = number of loops, 0=endless, default=1
oncomplete = actions that will be called on complete
pausesound(name)
pauses a sound
name = identification name of the sound
resumesound(name)
resumes a paused sound
name = identification name of the sound
pausesoundtoggle(name)
pauses OR resumes a sound
name = identification name of the sound
stopsound(name)
stops playing a sound
name = identification name of the sound
stopallsounds()