Sie sind nicht angemeldet.

1

Sonntag, 10. Juli 2022, 20:17

stream multiple sounds in vtour and loop

I'm using maybe the simplest code to loop a music in the vtour across all scenes

Quellcode

1
<krpano version="1.20.11" title="Now Viewing" onstart="playsound(bgsnd,'audio/01.ogg',true,0.7);">

This works without a glitch.
What i need is to get a series of music to play one after the other and have this loop after the last music.
that would be like streaming some music without having to listen to a single one all the time.

2

Montag, 11. Juli 2022, 02:15

You may just use

sound[name].oncomplete

to start the next one. And so on. Or write a little function to do so for all your sounds.

3

Montag, 11. Juli 2022, 08:46

Hello try this. list sound=" 1, 2, 3 ..." - list of paths to audio files.
The list will play in a circle

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<krpano version="1.20.11" title="Now Viewing" onstart="set(num_sound, 0); play_s()">
	
<!-- audio list -->
<list sound="audio/01.ogg, audio/20.ogg, audio/33.ogg"  /> 
	
<action name="play_s"  > 
	txtsplit(get(list.sound), ',', arr); 
	copy(var, arr[get(num_sound)].value); 
	playsound(bgsnd, get(var), false, 0.3, play_s() );		
	if(num_sound LT (arr.count - 1),
		inc(num_sound);
		,
		set(num_sound, 1);
	);
</action> 

4

Montag, 11. Juli 2022, 15:06

Yes it's exactly what I needed! You just opened the way to a streaming radio in the KRpano... Many thanks San!