Sie sind nicht angemeldet.

1

Mittwoch, 8. Juni 2022, 14:29

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()

Quellcode

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


Any idea how to make it work?

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »TaurusTheBlack« (12. Juni 2022, 02:55) aus folgendem Grund: The problem was solved.


Tuur

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

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

  • Nachricht senden

2

Donnerstag, 9. Juni 2022, 09:22

Hi,

just try:

Quellcode

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

Sonntag, 12. Juni 2022, 02:55

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

Donnerstag, 8. September 2022, 11:34

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.