The Daily Click ::. Forums ::. Klik Coding Help ::. -Question About Music-
 

Post Reply  Post Oekaki 
 

Posted By Message

-MacAdaM-

Megaman Fosho

Registered
  12/02/2008
Points
  560
18th June, 2008 at 19:11:08 -

How would I get an Mp3 to play during runtime?
Theres no "Play Mp3 button" (But there should be *Hint* *Hint*)
What could I do to make this work?

 
Your just jealous that you're not as awesome as me.
(And my megaman avatar )

aphant



Registered
  18/05/2008
Points
  1242
18th June, 2008 at 19:22:53 -

You could use OGG files instead. They're supported by default. Unless it has to absolutely be an mp3, then you'll have to use an extension.

 

-MacAdaM-

Megaman Fosho

Registered
  12/02/2008
Points
  560
18th June, 2008 at 19:41:46 -

Well i'm going to try and make a guitar hero type game.
And in the background theres going to be music you need. (like Guitar Hero)

Could I find songs in the OGG format you were talking about?
Or is there a program that can convert them.?

 
Your just jealous that you're not as awesome as me.
(And my megaman avatar )

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
18th June, 2008 at 20:56:30 -

Goldwave has a lengthy trial you can download, that converts almost anything to almost anything. Mp3 to Ogg is one of those.

 
.

aphant



Registered
  18/05/2008
Points
  1242
18th June, 2008 at 21:03:47 -

Audacity can also do mp3 to ogg, and it's open source and free.

 

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
19th June, 2008 at 02:13:12 -

Audacity is the mutts nuts. If you get the Lame_enc.dll (legal and free) you can encode into MP3 again. But go for OGG. That also is the mutts nuts.

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

Roseweave



Registered
  31/07/2007
Points
  341
19th June, 2008 at 06:45:12 -

You shouldn't use mp3s for games. OGG files are capable of going very small without sounding "Watery". You can have a 4 minute song under a meg and it'll still be listenable.

 
Check out my Telekinesis'em'up Thread and the ALICE Machines -

http://www.create-games.com/project.asp?id=1213

"Did you know there's a million bucks hidden in the house next door?"
"But there is no house next door?"
"No? Then let's go build one!"

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
19th June, 2008 at 10:32:06 -

I attempted a Guitar Hero engine for use in my "accordion hero"... oughta get back to that... But I had an issue with timing... I recorded the button configs by using a recording level, but stupid me used a list object, which apparently doesn't seem to want to cooperate. It read at a different speed than it wrote. (Even though I made it read one line at a time every .02 seconds...) Mind telling me how you're doing it?

 

  		
  		

aphant



Registered
  18/05/2008
Points
  1242
19th June, 2008 at 13:05:13 -

If I were to make a recording level, then I would use an array. Using the average human reaction time (160ms, according to Wikipedia) to construct an event that reads for input every 40ms or 20ms. (In other words, every 0.02 or 0.04 seconds.) At those intervals, the recorder would add a value (equaling what buttons are pressed) to the current line and then set it to the next line.

Then we'd need a way to find what buttons are pressed. I'm using a 4-button setup in this example: A, B, C, and D, with Spacebar as strum. Pressing A would add 1 to a counter. B, 2; C, 4; D, 8. We're doing powers of 2 because then you could hold any combination of buttons without it equaling any of the values they use. While the key(s) is down, the counter would be positive. But, upon pressing (and while pressed) the Spacebar, the counter is multiplied by -1, making it negative. By differentiating between positive and negative, you'd be able to create the initial note gem or a sustained note; The parser would interpret negative values as being when to strum. The button-combo value would then have to be compared to the current line of the array.

An early problem is determining what values equal what combined keys, but that's easily rectified:
0 = none
1 = A
2 = B
3 = AB
4 = C
5 = AC
6 = BC
7 = ABC
8 = D
9 = AD
10 = BD
11 = ABD
12 = CD
13 = ACD
14 = BCD
15 = ABCD

Adding more buttons would just mean that higher numbers would be needed. 5th button = 16, 6th = 32, 6th = 64, Nth = 2^N... And then all of the values in-between have to be determined. Also, my primitive understanding is that all 16 values (we have to include 0) have to be their own seperate conditions. And this is just to create the appropriate notes on screen.


Actual gameplay would be much simpler:
+ Counter = current value ("Array")
- Add to score, destroy note gems, what have you.

+ Counter <> current value ("Array")
- The player missed a note or whatever.

I could go on some more about this, but then I might as well just make my own GH-esque game. Plus, I forgot what I was originally going on about.

 

jbjovi



Registered
  22/07/2007
Points
  41
19th June, 2008 at 13:32:31 -

One problem that you may encounter is that a lot of system (keyboards ?) doesn't accept more than 3 keys pressed at the same time...

 
n/a

-MacAdaM-

Megaman Fosho

Registered
  12/02/2008
Points
  560
19th June, 2008 at 14:00:36 -

Something else I noticed is that I cannot play OGG format files either.
Soooooooo. Im back right were I started.

 
Your just jealous that you're not as awesome as me.
(And my megaman avatar )

-MacAdaM-

Megaman Fosho

Registered
  12/02/2008
Points
  560
20th June, 2008 at 12:32:16 -

Anyone? I really need some help.

 
Your just jealous that you're not as awesome as me.
(And my megaman avatar )

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
20th June, 2008 at 14:07:42 -

Why can't you play OGG? Players like windows media player don't play Ogg for some reason.

 
.

-MacAdaM-

Megaman Fosho

Registered
  12/02/2008
Points
  560
20th June, 2008 at 23:23:13 -

I need something that TGF2 can read. and OGG doesnt work =/
I could use .wav, but those are big, and will make my game huge.
hahah, i need help

Image Edited by the Author.

 
Your just jealous that you're not as awesome as me.
(And my megaman avatar )

viva/volt

Awesome Sauce

Registered
  26/08/2006
Points
  1694

Game of the Week WinnerSilverNova MemberKlikCast StarVIP Member
20th June, 2008 at 23:57:11 -

TGF1 can't play anything except midi and wav using the built in system...

There are extensions but they never were very good IIRC.

 
Image
http://bfollington.tumblr.com
   

Post Reply



 



Advertisement

Worth A Click