Looping music from the middle point?
Right now, I am using music in .ogg format in my game. I am wondering if there are any extensions, or codes that can play a song as a single file, and loop it in the middle of it instead of looping back to the beginning of the song? Whether its a code/extension that plays mp3/ogg/or wav files at mid point of the song, i wouldn't think it matters.
Since I can't seem to find any other way right now, I have split the song into 2 .ogg files. One that plays the first bit once, and the middle looping point is a file of its own.
Although it would help if there was another way around this instead of using 2 files just for a middle loop point in a game.
Re: Looping music from the middle point?
Use the sample action: set sample position :)
Re: Looping music from the middle point?
Umm.... I am going to need more information than just that. Like how do I know where to set the channel position, and when? And will this effect the FPS of the game? For example, any unexpected pausing, etc?
It appears that there isn't a trigger that checks for the current sample's position by itself. Just triggers that checks if a sample not playing, a specific sample not playing, specific channel not playing, or if the samples/channels are paused. The only thing I saw that came close was comparing a counter to whatever sample you set it to, to its duration, or current position.
I also noticed if you have a code/trigger to set sample position in the middle, if you have the application paused (usually ctrl+p), the sample stops playing, assuming you only play the sample once. Seeing that when I set the sample to loop 0, I can't correctly set the sample position in the middle when it reaches its last duration.
Re: Looping music from the middle point?
Use compare 2 general values to test the sample position.
Re: Looping music from the middle point?
Well my other points still remain valid. Like the point of which the user pauses the application (ctrl + p) it won't check any of the conditions. In other words, if I have the sample play once (no loop), and make new condition when counter >= samples duration to set position to certain #. This will not work into effect unless the application is in focus (not paused, etc). This probably applies as an internet file too.
If the sample stops playing while paused and skips the counter >= sample duration condition, well, its just not going to loop any more until I set it to play the sample again.
Therefore, there is possibly going to be a slight aplication pause every time the sample ends, and tries to loop at a defined position.