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 doesn't loop

Author
Message
Mmarzex
11
Years of Service
User Offline
Joined: 26th Feb 2013
Location:
Posted: 28th Feb 2013 08:30
So in tier two I have my music declared as such



Now I start to play it as such


Now that should loop it but it stops after it plays once and I am not sure why that would be.
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 28th Feb 2013 11:12 Edited at: 28th Feb 2013 11:14
In 1076 I had to use this to stop it from going to the next music. I suspect that could work for you as well.




Demo 3 is out now!
Mmarzex
11
Years of Service
User Offline
Joined: 26th Feb 2013
Location:
Posted: 28th Feb 2013 14:42
I tried that and it doesn't work like that either. I tried it with an mp3 and a wav. It just always stops after the first play through no matter what.
Ian Rees
AGK Developer
12
Years of Service
User Offline
Joined: 3rd May 2012
Location: Wales, UK
Posted: 28th Feb 2013 21:07
I use a function in the main loop to see if the music is playing (sorry it's tier 1 code):



E

http://www.superiorinteractive.com/galaforceworlds
Mmarzex
11
Years of Service
User Offline
Joined: 26th Feb 2013
Location:
Posted: 1st Mar 2013 02:02
I tried that. I play the music in the begin loop but checking if music is playing doesn't do anything either. I really don't see why this is.
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 1st Mar 2013 05:46
Which Tier 2 platform are you developing on? Can you post the complete source code from a project that does this so we can see the entire picture?
Mmarzex
11
Years of Service
User Offline
Joined: 26th Feb 2013
Location:
Posted: 1st Mar 2013 07:48
Yeah here is my complete source code for this


I'm developing on xcode on a mac and I think the correct version number is 10776 or something along that number for AGK.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 1st Mar 2013 16:38
The way you have the code now, it keeps trying to play the music in the main loop.

I am assuming that it wasn't working correctly (not looping) when you did NOT have the PlayMusic call in the app::Loop method?

Because, having started it in the app::Begin method, you would not need to call it ever again (especially not in the app::Loop method).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Mmarzex
11
Years of Service
User Offline
Joined: 26th Feb 2013
Location:
Posted: 1st Mar 2013 18:09
But why would I call it in the loop. Wouldn't that mean that it is restarted every frame and would effectively sound like it wasn't playing? IT is really unclear where that would have to go to make it actually loop.

Also when does this post moderation stop? It is really frustrating that having paid for the SDK I still have to sit around waiting for my posts to be approved.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 1st Mar 2013 19:13
Sorry, I misread the posted code and didn't properly parse the comment start/stop points.

Post moderation stops after they see that your posts are generally okay with the forum rules and information and stuff. It doesn't take very long.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Mmarzex
11
Years of Service
User Offline
Joined: 26th Feb 2013
Location:
Posted: 1st Mar 2013 19:20
It is okay, it happens. Is this music thing a widespread bug? Also I tried to download the beta but it isn't only as an executable. Is there an osx version available?

I understand the desire to moderate the posts but I mean I paid for AppGameKit and currently the forums are my only line of support so I really shouldn't be moderated at all in this circumstance.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 1st Mar 2013 21:19
Currently, for the beta, there is no separate zip file for the Mac. This will be provided when they officially release v108 (or v109).

But within the installed AppGameKit version, the iOS and Mac directories exist. You copy the AGK/IDE directory to your Mac and then do a fix for scrambled Facebook directory as decribed on the AGK Wiki Templates page in the "Facebook (v1085+)":"iOS/Mac Project" section.

Given that you most recent post appeared 7 minutes after mine, your posts don't appear to be being delayed. So, they probably aren't being heavily moderated at this stage. It is always prudent for there to be some oversight on new posters in any forum, just to be sure that they are legitimate.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Mmarzex
11
Years of Service
User Offline
Joined: 26th Feb 2013
Location:
Posted: 1st Mar 2013 22:26
Alright maybe I will try the beta for sound since nothing seems to work to play continuous sound which is ridiculous. I'm thinking of maybe loading it twice and trying to loop that and see if it works.

Is there anyway to start music once the begin block is loaded?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 2nd Mar 2013 05:22
Sure, you can start music whenever you want. But, making sure that you don't keep restarting it (so that it never actually plays) is the trick. In theory, checking to see if it is playing first should work. But you said that didn't.

I know there are some samples of playing music in the example projects. Can you try loading one of those files and see if it loops? Just in case it is something in your music file.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Mmarzex
11
Years of Service
User Offline
Joined: 26th Feb 2013
Location:
Posted: 2nd Mar 2013 22:47
The example did not work either. Is there anything I can do to make this music work?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd Mar 2013 17:28
I misread your previous post. It is not a good idea to load the music more than once, that just makes your app work harder.

You can load it wherever you like, but really don't need to load it more than once.

If I get the time later today, I will try a Tier 2 test with music and see if I have the same problem.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Mmarzex
11
Years of Service
User Offline
Joined: 26th Feb 2013
Location:
Posted: 4th Mar 2013 20:28
Through some random things I am trying. I use this snippet of code to try and get it to play as many times as possible



Now it still only actually plays the music once but once the music stops it still prints out times every loop saying the music is in fact playing. Yet no sound is heard. Any ideas?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Mar 2013 21:15
I just tested the following on my Mac, in both AppGameKit v1076 and v1088, with a 20 second extract from the SpaceShooter track1.mp3 file.

In v1088, the music ran and looped repeatedly. If I comment out the PlayMusic command in app::Begin(), I get the "Starting music" pop-up message and then it loops fine.

In v1076, the music played once, apparently stopped, but the app thought it was still playing.

So, it is clearly a bug in Mac libraries in v1076 that has been fixed in v1088.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Mmarzex
11
Years of Service
User Offline
Joined: 26th Feb 2013
Location:
Posted: 4th Mar 2013 21:40
That's interesting. I will have to try the beta. Got to wait to get on a windows capable device first though to get everything out of the exe. If I switch to using 1088 while what I already have done work fine?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Mar 2013 21:48
Sort of.

You will need to create a new project from one of the templates on the AGK Wiki Templates page in order to make sure that you have all the correct settings and core AppGameKit files (which are part of the project and not in a shared location). You can probably copy your template.cpp and template.h files directly from the old project, as well as any other files you added to the project and your media directory.

I would suggest installing v1088 in a new directory instead of on top of your old v1076 one. Multiple versions can exist in all of the environments, as long as they are all in their own directories.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Mmarzex
11
Years of Service
User Offline
Joined: 26th Feb 2013
Location:
Posted: 4th Mar 2013 22:02
Alright sounds good, I will have to try the beta and see if it fixes the problems.

Thank you so much for all your help!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Mar 2013 22:08
No sweat.

Happy Programming!

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-05-06 15:10:26
Your offset time is: 2024-05-06 15:10:26