close panorama

HTML5-VR Audio Plugin
with smart IDE sound manager repository folder, DEMO for HTML5 and WebVR! (Oculus Rift, Google Cardboard, GearVR, ...)
by Spacery Wirtualne - biuro@spacerywirtualne.pl

Description

Most of the functions of this plugin is similar to the Sound Interface Plugin krpano. We worked hard to get the functions that will be similar to Sound Interface Plugin krpano methods.
The Sound Interface plugin extends krpano with actions for playing and controlling sounds directly from xml.

Note

  • Works fine with Panotour Pro
  • Plugin allows you to easily add sound objects
  • Works only in HTML5 and krpano version min. 1.19 pr4
  • Plugin supports mp3 and ogg files. Both files must have the same name and be in the same location
  • It works best in browsers that support the Web Audio API

VRmode compatible

Plugin works great in VR mode hardsets.


Installation

Easy to install

  1. Copy the folder 'html5sound' to your project root
  2. In the header index.html file add the following lines of code:
    <html>
    <head>
    	[...]
    	<script src="html5sound/js/howler.core.min.js"></script>
    	<script src="html5sound/js/howler.effects.min.js"></script>
    	[...]
    	</head>
    		<body>
    		[...]
    		</body>
    	</html>
    	
  3. Put in your main xml file this line of code:
    <include url="%FIRSTXML%/html5sound/xmls/init.xml"/>
    <include url="%FIRSTXML%/html5sound/gui/xmls/init.xml" />
  4. In Panotour Pro put in your main xml file this line of code:
    <!-- ptp_datafolder_name = name of the folder repository, generated by Panotour Pro --/>
    
    <krpano ptp_datafolder_name="tourdata" generated_by_panotour="true"/>
    <include url="%FIRSTXML%/html5sound/xmls/init.xml"/>
    <include url="%FIRSTXML%/html5sound/gui/xmls/init.xml" />
  5. done


Youtube instuction

Buy / Order the plugin

NOTE - this is a commercial plugin - to use it - it must be purchased.

You can purchase this plugin through the link below.
Updates for this plugin are free!

HTML5-VR Audio Plugin

45 €

Notes:

  1. Works only in HTML5 and krpano version min 1.19 pr4!
  2. Don't encrypt the init.xml file in the html5sound folder.

Documantation

HTML5 Sound Interface Plugin will be developed dynamically, so the latest documentation is available online on the krpano forum.

The current documentation

Plugin Actions

The HTML5 Sound Interface plugin add its actions directly to the krpano root. That means the actions can be called like normal krpano actions.
  • playHtml5sound(name, audiofile, loop*, volume*, oncomplete*);
    • preloads a sound file
    • name = identification name for the sound
    • audiofile = the path and filename of a sound file without extension
    • loop = true/false (default=false)(*optional)
    • volume = sound volume (0.0 - 1.0, default=1.0)(*optional)  (Web Audio Api only)
    • oncomplete = actions that will be called on complete (*optional)
  • playHtml5sound2D(keep, name, audiofile, rate*, volume*,loops*, onload*, onplay*,onpause*,onstop*,onmute*, oncomplete*);
    • preloads a sound file
    • keep = if true - remains on the next panorama (true/false, default=false)
    • name = identification name for the sound
    • audiofile = the path and filename of a sound file without extension
    • rate = playback speed (0.5 - 4.0, default =1.0) (*optional)  (Web Audio Api only)
    • volume = sound volume (0.0 - 1.0, default=1.0)(*optional)  (Web Audio Api only)
    • loops = true/false (default=false)(*optional)
    • onload = actions that will be called on sound loaded (*optional)
    • onplay = actions that will be called if the sound start to play (*optional)
    • onpause = actions that will be called if the sound is paused (*optional)
    • onstop = actions that will be called if the sound is stopped(*optional)
    • onmute = actions that will be called if the sound is muted/unmuted (*optional)
    • oncomplete = actions that will be called on complete (*optional)
  • playHtml5sound3D(keep, name, audiofile, ath, atv, range, rate*, volume*, loops*, onload*, onplay*, onpause*, onstop*, onmute*, oncomplete*);  (Web Audio Api only)
    • plays a sound file with adjustable volume and panning
    • keep = if true - remains on the next panorama (true/false, default=false)
    • name = identification name for the sound
    • audiofile = the path and filename of a sound file without extension
    • ath = horizontal sound source position (-180 .. 180)
    • atv = vertical sound source position (-90 .. +90)
    • range = range of the sound (in degrees, 10-360)
    • rate = playback speed (0.5 - 4.0, default =1.0) (*optional)
    • volume = sound volume (0.0 - 1.0, default=1.0)(*optional)
    • loops = true/false (default=false)(*optional)
    • onload = actions that will be called on sound loaded (*optional)
    • onplay = actions that will be called if the sound start to play (*optional)
    • onpause = actions that will be called if the sound is paused (*optional)
    • onstop = actions that will be called if the sound is stopped(*optional)
    • onmute = actions that will be called if the sound is muted/unmuted (*optional)
    • oncomplete = actions that will be called on complete (*optional)
  • playHtml5sound3DHS(keep, name, audiofile, hotspotname, range, rate*, volume*, loops*, onload*, onplay*, onpause*, onstop*, onmute*, oncomplete*);  (Web Audio Api only)
    • plays a directional 3D sound at a hotspot position - when the hotspot moves the sound will follow it
    • keep = if true - remains on the next panorama (true/false, default=false)
    • name = identification name for the sound
    • audiofile = the path and filename of a sound file without extension
    • hotspotname = name of the parent hotspot
    • range = range of the sound (in degrees, 10-360)
    • rate = playback speed (0.5 - 4.0, default =1.0) (*optional)
    • volume = sound volume (0.0 - 1.0, default=1.0)(*optional)
    • loops = true/false (default=false)(*optional)
    • onload = actions that will be called on sound loaded (*optional)
    • onplay = actions that will be called if the sound start to play (*optional)
    • onpause = actions that will be called if the sound is paused (*optional)
    • onstop = actions that will be called if the sound is stopped(*optional)
    • onmute = actions that will be called if the sound is muted/unmuted (*optional)
    • oncomplete = actions that will be called on complete (*optional)
  • Html5Soundvolume(name, value);  (Web Audio Api only)
    • volume settings
    • name = identification name of the sound
    • value = 0.0 - 1.0 (Number)
  • Html5Soundplay(name);
    • resumes a paused sound
    • name = identification name of the sound
  • Html5Soundpause(name,variable);
    • pauses a sound
    • name = identification name of the sound
    • variable (not required) = true - pause is ON, false - pause is OFF (Boolean)
      Html5Soundpause(name,false); - It works the same way as Html5Soundplay(name);
  • Html5Soundstop(name);
    • stops playing a sound
    • name = identification name of the sound
  • Html5Soundmute(name,variable);
    • stops playing a sound
    • name = identification name of the sound
    • variable = true - mute is ON, false - mute is OFF (Boolean)
  • Html5Soundrate(name, value);  (Web Audio Api only)
    • playback speed settings
    • name = identification name of the sound
    • value = 0.5 - 4.0 (Number)
  • Html5SoundSetSeek(name, value);  (Web Audio Api only)
    • Set the seek of the sound
    • name = identification name of the sound
    • value = in second (Number)
  • Html5SoundGetSeek(name, dstvar);  (Web Audio Api only)
    • Get the seek value of the sound
    • name = identification name of the sound
    • dstvar = The destination variable name where the seek will be stored
  • Html5SoundUnload(name);
    • Unload and destroy a sound object from project
    • name = identification name of the sound