Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Music Question

Author
Message
ManOfActionTM
12
Years of Service
User Offline
Joined: 16th May 2011
Location: Sahuarita, Arizona
Posted: 5th Apr 2014 02:03
I have a short song playing (we'll call it song 1), and I'm waiting for song 1 to end by checking the GetMusicPlaying command. Once song 1 has stopped playing, I want to play another song (song 2), but song 2 loops.

I'm noticing a slight gap between song 1 and song 2 (probably just enough time for GetMusicPlaying to register as not playing), is there another way to do this?
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 5th Apr 2014 06:02 Edited at: 5th Apr 2014 06:05
yup its all in the way your calling playmusic as it has loop music commands built in it.

so your song doesnt loop type this:

loadmusic(1,"blah.mp3")
playmusic(1,0,1,1)// (#song id,#loop song,#playlist start song,#playlist endsong)

and if you just want to play 2 songs back to back without looping then do this...

loadmusic(1,"blah.mp3")
loadmusic(2."blah.mp3")
playmusic(1,0,1,2)// thats without looping

change that 0 to 1 if you want it to loop

ManOfActionTM
12
Years of Service
User Offline
Joined: 16th May 2011
Location: Sahuarita, Arizona
Posted: 5th Apr 2014 21:44
okay, that's close to what I'm looking for, but not quite.

What I want is:

playmusic(song1) //once

//after song1 ends
playmusic(song2) //loop
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 7th Apr 2014 06:55
ah... i know exactly what you mean.

in that case do this if ya like:

loadmusic(1,"blah.mp3")
loadmusic(2,"blah2.mp3")

playmusic(1,0,1,1)//once


do

//somewhere in your game loop
if getmusicplaying(1)=0 and getmusicplaying(2)=0
playmusic(2,1,2,2)
endif


sync()
loop


or just code something in to catch when you have switched over to your second song. i will tell ya however that agk will still leave a pause inbetween songs unfortunetly. no way around it unless they were wav files using the sound commands.

ManOfActionTM
12
Years of Service
User Offline
Joined: 16th May 2011
Location: Sahuarita, Arizona
Posted: 7th Apr 2014 16:38
Yeah, that's the problem I'm experiencing. I essentially have that exact code (in Tier 2) and there is a slight pause.

So perhaps, because that first song is fairly short (less than 4 seconds) I could use the Sound commands, but how would I code that any differently? Wouldn't it have that same delay?
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 7th Apr 2014 20:30
No way to loop music without a pause. Only sounds can be seamlessly looped.

ManOfActionTM
12
Years of Service
User Offline
Joined: 16th May 2011
Location: Sahuarita, Arizona
Posted: 7th Apr 2014 22:28
So what you're saying is, if I want looping music, it has to be a .wav file? That's pretty terrible!

So our idea of having one sound start off the game (think of a '1, 2, 3, 4!'), followed by looping music in .m4a is impossible to play seamlessly?

No one thought this was a bad idea?

So if that's the case, is there a way to rip out the audio system and replace it with a 3rd party one in T2? Or fix what's broken?

I'm making a music edutainment game, and having the song not start on '5' after 1, 2, 3, 4, makes it a little bit confusing.
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 7th Apr 2014 22:43
Many people have asked for this. I think I was the previous one to bring up this topic. The reply I got from other users was that it was pretty much impossible to implement into AGK. It's definitely a feature I want.

ManOfActionTM
12
Years of Service
User Offline
Joined: 16th May 2011
Location: Sahuarita, Arizona
Posted: 8th Apr 2014 00:26
So is there a 3rd party option to do the sound for T2? Or am I stuck with a choice of re-starting my game on another engine?
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 8th Apr 2014 00:35
AGK is using the platform's streaming system. That always has latency, because there's a file access and seek.

Use a bridge sound (WAV)- like a cymbal roll - and trigger that when the music track ends and immediately trigger the music again and nobody will notice.

Streaming was never designed for seamless looping.

-- Jim - When is there going to be a release?

Login to post a reply

Server time is: 2024-05-11 13:34:49
Your offset time is: 2024-05-11 13:34:49