News Examples Documentation Download Buy Forum Contact
NOTE: This page is from an older version, see the latest version here.

Sound Interface Plugin soundinterface.swf Version 1.0.8-beta

  • 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!

Syntax

Simple include syntax:
<plugin name="soundinterface" url="soundinterface.swf" preload="true" />

Full include syntax with all available settings:
<plugin name="soundinterface"
        url="soundinterface.swf"
        preload="true"
        rootpath=""
        volume="1.0"
        mute="false"
        />

Plugin Attributes

  • rootpath  (optionally)
    • root path for the the sound files
    • relative from the xml file, default=""
    • it's possible to use placeholders like %SWFPATH% here
  • volume  (optionally)
    • the global volume for all sounds
    • 0.0 - 1.0, default=1.0
    • can be dynamically changed by actions (set(), tween(), ...)
  • mute  (optionally)
    • set the global mute for all sounds
    • true or false, default=false
    • can be dynamically changed by actions (set(), tween(), ...)

Plugin Actions

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 (use "auto" for an automatic id)
    • mp3file = the path and filename of a sound file
    • loops = number of loops, 0=endless, default=1 (*optional)
    • oncomplete = actions that will be called on complete (*optional)
  • playsound2D(name, mp3file, volume*, pan*, loops*, oncomplete*)
    • plays a sound file with adjustable volume and panning
    • name = unique identification name for the sound (use "auto" for an automatic id)
    • mp3file = the path and filename of a sound file
    • volume = sound volume (0.0 - 1.0, default=1.0) (*optional)
    • pan = left/right panning (-1.0(=left) - +1.0(=right), default=0.0) (*optional)
    • loops = number of loops, 0=endless, default=1 (*optional)
    • oncomplete = actions that will be called on complete (*optional)
  • 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 (use "auto" for an automatic id)
    • 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) (*optional)
    • volume = sound volume (0.0 - 1.0, default=1.0) (*optional)
    • loops = number of loops, 0=endless, default=1 (*optional)
    • oncomplete = actions that will be called on complete (*optional)
  • 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 (use "auto" for an automatic id)
    • 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) (*optional)
    • volume = sound volume (0.0 - 1.0, default=1.0) (*optional)
    • loops = number of loops, 0=endless, default=1 (*optional)
    • oncomplete = actions that will be called on complete (*optional)
  • 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 (use "auto" for an automatic id)
    • mp3file = the path and filename of a sound file
    • hotspotname = name of the hotspot
    • range = range of the sound (in degrees, default=90) (*optional)
    • volume = sound volume (0.0 - 1.0, default=1.0) (*optional)
    • loops = number of loops, 0=endless, default=1 (*optional)
    • oncomplete = actions that will be called on complete (*optional)
  • 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()
    • stop all playing sounds