Looping Music

For questions about using Classic.

Post » Tue Mar 01, 2011 8:38 am

Is there any way to loop music without that awful pause? I've gotten a lot of complaints on it and..well..it seems there's nothing I can do about it. It took my friend a while to make these tunes and now I can't even play them properly. :?

I'm using "play music from resource." I tried loading them externally, which I think fixed the pause, but I'm using magicam so the music completely stopped during room transitions. Un-checking "Time-Scale Audio" surprisingly didn't fix it.

Any ideas?
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Tue Mar 01, 2011 2:59 pm

Is the pause coming from the music itself (ie it stops and starts again), or was the song made as a loop?


I haven't used music a whole lot, but the few times I did, playing a .wav file from a channel set to loop produced no noticeable pauses. Then again, I'm not sure if that was because of Construct or how the song was.
Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
7
S
2
G
2
Posts: 193
Reputation: 1,561

Post » Tue Mar 01, 2011 3:15 pm

All of the songs were designed to loop, and they loop perfectly in my media player.
[quote="Emperor Ing":2xa31mp4]I haven't used music a whole lot, but the few times I did, playing a .wav file from a channel set to loop produced no noticeable pauses. Then again, I'm not sure if that was because of Construct or how the song was.[/quote:2xa31mp4]

Likewise. From what I recall the music looped just fine, but again, magicam (during room transitions) stops music on a reserved channel like that so I'll have to find another way..or talk to Linkman about it..hm.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Tue Mar 01, 2011 3:33 pm

In your first post you said that you are using "play music from resource", in your second you talk about magicam stopping music "on a reserved channel". XAudio2 knows music and sound - music is played directly (and parallel to the sound channels) and sound can be played on channels. And only for the latter you may reserve channels. Also, music is never chached, while you have full control over caching sound. If it is music you are using, then it might be that room transitions block access to the harddisc and because of music not being cached, it can't be played during that time.

I assume you're using exactly one XAudio-object set to "global". Try playing the loops as wav via channels and set a high cache value plus using "cache file" or "cache directory". Other than that, there is only the way of fixing (if it is a bug) magicam.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Tue Mar 01, 2011 3:35 pm

I've never used the camera plugin beyond watching the demo. So this is sortof a shot in the dark, I recall seeing a demo for camera room transitions like old LOZ(I think it was from the plugin). This might have been accomplished with a momentary pause of the timer which would freeze everything happening pretty much. Try manually setting system timescale to the normal rate at evry tick. If my guess is correct, and the plugin is designed to affect timescaling at the beginning of the tick it might fix it, at the expense of making the room transition slightly less cool
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Tue Mar 01, 2011 4:01 pm

[quote="tulamide":2hxzojz1]In your first post you said that you are using "play music from resource", in your second you talk about magicam stopping music "on a reserved channel". XAudio2 knows music and sound - music is played directly (and parallel to the sound channels) and sound can be played on channels. And only for the latter you may reserve channels. Also, music is never chached, while you have full control over caching sound. If it is music you are using, then it might be that room transitions block access to the harddisc and because of music not being cached, it can't be played during that time.

I assume you're using exactly one XAudio-object set to "global". Try playing the loops as wav via channels and set a high cache value plus using "cache file" or "cache directory". Other than that, there is only the way of fixing (if it is a bug) magicam.[/quote:2hxzojz1]

Sorry, as always I could have been a little more clear -w-;

What I meant was I used to play music by doing exactly what you mentioned above, but that caused Magicam to pause the music during transitions. Due to this, I resorted to using "Play Music From Resource". That fixed the transition problem, but now there's a pause between loops. But yes, I think the only way to fix this is through Magicam. I've contacted Linkman so we'll see if something can be done.

Edit: Actually, Lucid, your idea works...for the most part :mrgreen: I'll have to mess with it a bit but I think it'll do.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Tue Mar 01, 2011 6:40 pm

What audio format are you using? Mp3 doesn't work good with looping. Ogg is much more suited to it.
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Tue Mar 01, 2011 7:16 pm

Like InkBot says, avoid using MP3 and use Ogg instead.

I have several pieces of music that loop throughout my game, and there's no sign of any pauses, clicks or pops when looping (using Ogg).

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Wed Mar 02, 2011 2:29 am

.ogg files don't work when using "play music from resource" or "autoplay resource", which is what I have to use to get magicam to not stop the music during transitions. Otherwise, Lucid's idea gets the music to keep playing during transitions, but in turn breaks the transition..so..Just waiting to hear from Linkman.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Fri Oct 17, 2014 11:50 pm

Are some new informations about play musicloop without pause? i´m also interested in this.
B
8
S
2
Posts: 53
Reputation: 687

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests