How can I play music?

For questions about using Classic.

Post » Sat Jan 24, 2009 12:59 pm

After reading some of the posts here, I have a suspicion that because I'm running Vista, I might not be able to play music in my game. I've been using MP3s and of course, that AudioX object or whatever it's called. I've even used MP3s in pathnames without any spaces, and tried doing that binary thing and playing it from resource, but still nothing. I really have no idea what's wrong here...
B
4
S
2
G
4
Posts: 164
Reputation: 1,878

Post » Sat Jan 24, 2009 1:00 pm

My understanding is that it is DirectSound that's the issue. If you're using the XAudio plugin, you should be all right.
B
2
S
2
G
3
Posts: 158
Reputation: 1,566

Post » Sat Jan 24, 2009 2:13 pm

XAudio2 has always been able to play music just fine for me... when you're loading a music from file, are you sure the filename exists? You could try AppPath & "myfile.mp3" and it'll load it from the same directory as the .exe/.cap.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sat Jan 24, 2009 2:32 pm

I haven't made a .exe file or anything, I mean just in testing it won't work.

Although... I'm fearing that there might be a different problem entirely. When I had Ulead Video Studio on the new laptop, and tried to throw in an MP3 with a video to try and make a video collage... It would have an illegal operation and close down. And on Windows Movie Maker... it can't play MP3s at all, forcing me to have to convert one of my MP3s to .wma for me to make my video collage.
B
4
S
2
G
4
Posts: 164
Reputation: 1,878

Post » Sat Jan 24, 2009 2:43 pm

XAudio2 can play WMA too, have you tried that?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sat Jan 24, 2009 2:50 pm

I thought I already said I did... but... I guess I forgot that detail. I tried, and that won't play either. ^^;;
B
4
S
2
G
4
Posts: 164
Reputation: 1,878

Post » Sat Jan 24, 2009 2:57 pm

Can you post a little .cap file which just has XAudio2 trying to play a .mp3 on start of layout from AppPath & "myfile.mp3", and if it doesn't work, upload the .cap and .mp3 somewhere so I can take a look?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sun Jan 25, 2009 8:43 am

Here it is. ^^; I dunno what I'm doing wrong with the coding or whatnot, but like I said, it may be a Vista (or more specifially, a "this laptop is just weird") problem. If you guys can get this working and I can't, I might consider installing Construct on this laptop just to see if I get the same problem on it. At this point, I'm putting down money that the problem is the new laptop itself.

[url:2az92yze]http://rapidshare.com/files/189040336/New_Game.zip.html[/url:2az92yze]

While I'm at it, I might as well go ahead and ask why exactly my pause function and collision box trigger doesn't work until after initiating them once. It's like, you have to trigger them twice to get them to work the first time, and every time after that, it works the way it should. And I've noticed that if you're moving right while pausing, it automatically moves the selection to "Quit" and selects it. I was wondering how to keep the Pause menu from being so sensitive in the first place.

Not that the second part there is nessecary, but just an afterthought after the music stuff.
B
4
S
2
G
4
Posts: 164
Reputation: 1,878

Post » Sun Jan 25, 2009 9:48 am

First off, Autoplay uses channels to play. MP3 doesn't play on a channel. Ashley already posted the link, but in case you missed it, here's the wiki article on XAudio2: http://apps.sourceforge.net/mediawiki/c ... io2_Object

But... even when I try "Play music," either from file or from resource, I can't get it to play :/. So I don't know what's up. It's not working for me either.

As for the menu pausing thing... you need your "On 'Enter' Key" triggers at the tops of your events, or they won't work properly. Since there are other events above them, "On 'Enter' Key" triggers as a new press each time the conditions above it are reached. For example:

[code:32byczfv]
+Every 5ms
+On Enter Key Pressed
->Do stuff
[/code:32byczfv]

If you hold down the Enter key just once, it will register as having a new keypress every 5 milliseconds.

Another thing to watch out for:
[code:32byczfv]
+Foo
+On Key
-> Foo is Goo

+Goo
+On Key
-> Goo is Foo[/code:32byczfv]
You will never get Goo, because it's changing right back to Foo. You need more detailed conditions so you're not canceling them out by accident.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Jan 28, 2009 10:01 am

It's not working for you either? ;_; That sucks... I wonder why...

And thanks for the suggestion about the order of conditions with that event. ^^; And I learned from your Platform School about how you can make new Event Sheets for totally different things to help make things run a little better. ^_^ So now I know.
B
4
S
2
G
4
Posts: 164
Reputation: 1,878

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests