You are not logged in.

1

Tuesday, January 5th 2021, 10:43am

Seek Sound

Hi guys,
so I wanted to play background sound in my tour.
So far so good, that works.

But I want to start the backgroundsound at a random second.
THIS

Source code

1
2
3
4
5
mul(val, random, 9);
    	roundval(val);
    	
    	playsound('backgroundsound','%VIEWER%/files/audio.mp3',true,1);
    	seeksound('backgroundsound', val);

sadly does not work. It still starts from the beginning.
When I trace val and the soundposition I get something like
"val = 3"
"pos = 0"
Obviously val is random, but the position is always 0.
Whats my problem here? Am I not seeing something obvious?

Tuur

Sage

Posts: 3,771

Location: Netherlands

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

  • Send private message

2

Tuesday, January 5th 2021, 10:59am

Hi,

Source code

1
seeksound('backgroundsound', val);

should be

Source code

1
seeksound('backgroundsound', get(val));


or

Source code

1
seeksound('backgroundsound', calc(val));


Hope it helps!
Tuur *thumbsup*

Similar threads