unlooping sound samples?

BlitzPlus Forums/BlitzPlus Programming/unlooping sound samples?

Mr Brine(Posted 2003) [#1]
Howdy all!

Im fairly certain it cant be done but I thourght i'd ask any how, yer never know!...Is it possible to unloop a looped sfx sample, with out having to reload it??

Thanks

Mr Brine


semar(Posted 2003) [#2]
You have a sfx sample, that you can load with loadsound command.

You can play it in a single shot, using playsound.

Or you can play it looped, using loopsound and then playsound.

You can stop, pause, and resume any sound (also looped sound) and you don't have to reload it again.

Hope I answered to your question.


Mr Brine(Posted 2003) [#3]
Alright Semar

I know about all the commands you described, but to put my question in code form:

t = loadsound("sfx.wav")
loopsound(t)

so now Ive loaded me sample in to memory and it's looped. My question is can I unloop 't' without having to reload it?

Hope this is a bit more understandable

Mr Brine


semar(Posted 2003) [#4]
Now I understand your question.

Hum... I *think* that once you've set the sound to be looped, you can't really change in a non looped one.

So you have to use two sound handlers here:
global t_looped = loadsound("sfx.wav") ;the looped one
loopsound(t_looped)

global t_unlooped = loadsound("sfx.wav") ;the unlooped one


I may be wrong though...

Hope this helps in someway,
Sergio.


rdodson41(Posted 2003) [#5]
I think that semar is right. That would be the only way to do it. Maybe you can make a userlib that unloops, or maybe one has been made. Good luck with that.