SFX Module/Audio: Play segments from a soundfile
25 April 2017 08:29
I'd like to play different segments from ONE soundfile in ONE speaker object with sfx.play(), let's say a passage from starting time A to endtime B, another passage from C to D, another from E to F etc.
My problem is that B4W's play function seems to always play soundfiles from the beginning, even if you define a loop from loopStart to loopEnd, it plays the file from the beginning up to loopEnd and ONLY THEN enters the defined loopStart-loopEnd cycle, so I cannot even get it to play the intended segment on the first run.
Is there a way to achieve this with coding or otherwise?
Also, there seems to be no option to define/limit the number of loop cycles. In most programs, you can set a loop parameter to 0 (infinite loop), 1 (play once), 2 (play twice) etc.
My problem is that B4W's play function seems to always play soundfiles from the beginning, even if you define a loop from loopStart to loopEnd, it plays the file from the beginning up to loopEnd and ONLY THEN enters the defined loopStart-loopEnd cycle, so I cannot even get it to play the intended segment on the first run.
Is there a way to achieve this with coding or otherwise?
Also, there seems to be no option to define/limit the number of loop cycles. In most programs, you can set a loop parameter to 0 (infinite loop), 1 (play once), 2 (play twice) etc.