You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, June 8th 2022, 2:29pm

SOLVED - Can't play same sound multiple times

Hi,

I have a single mp3 file, which I'd like to play everytime when a hotspot is clicked, but I only get it played on 1st click.

I tried many different approaches, but did not get it to work on 2nd click:
- both in hotspot's onclick as well as and in action
- preloadsound() in onxmlcomplete event
- createsound() before playsound()
- stopsound() and destroysound() before createsound()

Source code

1
2
3
4
<action name="play_sound">
createsound(sound, sample.mp3);
playsound(sound);
</action>


Any idea how to make it work?

This post has been edited 1 times, last edit by "TaurusTheBlack" (Jun 12th 2022, 2:55am) with the following reason: The problem was solved.


Tuur

Sage

Posts: 3,768

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

2

Thursday, June 9th 2022, 9:22am

Hi,

just try:

Source code

1
plugin[soundinterface].playsound(sound, sample.mp3);

https://krpano.com/plugins/soundinterface/#playsound


You need the sound interface plugin to be there of course.
https://krpano.com/plugins/soundinterface/#top

Hope it helps,
Tuur *thumbsup*

3

Sunday, June 12th 2022, 2:55am

SOLVED - Can't play same sound multiple times

Hi Tuur,

thank your for your answer. The example you provided did not work, in fact, it did not play the sound at all, and of course the Soundinterface Plugin was preloaded.

I even tried replicating some actions from Klaus' examples but always had the same issue. But I managed to find out what was causing all that in release notes :)

krpano 1.20.11 (build 2022-01-13)
  • Fix: Soundinterface Plugin - in some cases reusing an already played sound failed.

After downloading the latest version of the app and replacing the plugin all works just fine now :)

4

Thursday, September 8th 2022, 11:34am

Same Problem

Hi all,

I've been losing my every sense with this problem and I just can't get it fixed.

I tried your way of downloading the new app and updated all .js and .sfw files through said app, but the sound still won't play a second time.

Please I desperately need help!

Pausing the sound works without any problems, just when it's done playing, it won't restart again.

Thanks in advance!

EDIT: It works now that I definitely overwrote the old soundinterface plugin files. Simply updating them through krpano tools didn't work. Sorry for adding that to your post.