Hi
Version 3.1.1 is ready!
- A new global volume action: Html5SoundGlobalVolume(Number) - 0.0 - 1.0
- Now the plugin detects if the browser tab with your project is active, if it is not, then plugin automatically mutes the sound.
- The Howler core update
...
Version 3.0.0 (build 2017-08-17) is ready! Watch the video:
https://youtu.be/4XjmMcIenm8
...
In the last few projects, we apply our HTML5-VR Audio Plugin.
Surround sound not works on Internet Explorer (no Web Audio Api support) - it works on Edge (WIN 10).
Note:
Plugin supports mp3 and ogg files. Both files must have the same name and be in the same location.
Setting the angle of listening to a range = 360, the sound is played in a completely new characteristics. - NEW
Documentation - HTML5-VR Audio Plugin ver 2.0 beta1
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.
• Plugin allows you to easily add sound objects
• Works only in HTML5 and krpano version min. 1.19-PR3.
• It works in browsers that support the Web Audio API.
Plugin Actions
The HTML5-VR Audio 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*)
- plays 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)
- volume - sound volume (0.0 - 1.0, default=1.0)
- oncomplete - actions that will be called on complete (*optional)
- playHtml5sound2D(keep,name, audiofile, rate*,volume*,loops*, onload*,onplay*,onpause*,onstop*,onmute*, oncomplete*)
- plays a sound file
- keep - true/false
- name - unique 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)
- 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 (*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*)
- plays a directional 3D sound at a given spherical position
- keep - true/false
- name - unique 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 (*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*)
- 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)
- audiofile - the path and filename of a sound file
- hotspotname - name of the 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 (*optional)
- oncomplete - actions that will be called on complete (*optional)
- Html5Soundvolume(name,value)
- volume settings
- name = identification name of the sound
- value (0.0-1.0)
- Html5Soundplay(name)
- resumes a paused sound
- name = identification name of the sound
- Html5Soundpause(name)
- pauses a sound
- name = identification name of the sound
- Html5Soundstop(name)
- stops playing a sound
- name = identification name of the sound
- Html5Soundmute(name)
- mute the sound
- name = identification name of the sound
- Html5Soundrate(name,value)
- playback speed settings
- name = identification name of the sound
- value(0.5-4.0)
- Html5SoundSetSeek(name,value) - NEW
- set seek time in second
- name = identification name of the sound
- value = in seconds
- Html5SoundGetSeek(name,variable) - NEW
- get seek time in second
- name = identification name of the sound
- variable = the variable where the result will be stored
- Html5SoundGlobalmute(variable); - NEW
- global action to MUTE or UNMUTE for the all sounds:
- variable = true - mute is ON, false - mute is OFF (Boolean)
HTML5 and iOS (iPhone / iPad) Notes
Plugin works fine on iOS, Android.
A sound can't start to play automatically! An user interaction is needed to start playing the sound, e.g. a touch on the screen by the user.
WebVR Notes
Plugin works fine in WebVR mode.
If you use the function playHtml5sound3DHS, your hotspot must be set: distorted = true.
Only this kind of hotspots is supported by VR mode.
More information soon...
Piotr & Paweł