Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (292)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Playing Music  (Read 1259 times)
0 Members and 1 Guest are viewing this topic.
Offline DanK

Junior Member




Javver games rock yawel!


« Posted 2004-06-01 07:37:04 »

I'm planning to put music into a game I've been working on in the next few days, and well... I wanted to know what people here recommend. I'd like to have a reasonable level of quality for the music, but I haven't ruled out midi just yet either. Most likely whatever I go with will be about a 30 second loop that'll probably fade in or out whenever the music begins/stops/changes.

So here are some of the things I'm not sure about...

What format to save the music files in (assuming I didn't go with a midi approach)? A wav file would probably be simple but that seems kind of like using an  uncompressed bmp image these days, my game would most likely be distributed via webstart so size is an issue.

Is speed likely to be a problem? I already loop a few sounds in my game but those are very short clips, and I suspect that something larger is going to either require a lot more time due to the amount of memory used or based on it not being loaded into memory at all and streamed in due to size.

Soundbanks for windows... is this something an end user would potentially have to deal with, or has it become part of the core distribution since sometime after 1.3?

I appreciate any feedback on these questions, sound isn't something I've messed with much, and short of moving my music off of CD into mp3's on my computer my file format know how is pretty much nothing (wavs are accurate but massive, and mp3 are small but I imagine playback in java wouldn't be ideal especially with everything else my game is already doing but if I'm wrong please correct me on that point).

Offline Matzon
« League of Dukes »

JGO Knight


Medals: 13
Projects: 2


I'm gonna wring your pants!


« Reply #1 - Posted 2004-06-01 08:05:59 »

Wave files, isn't really an option due to size issues. However you may be able to use ogg vorbis, and then decompress those to wav files at runtime (or installation time). There is a vorbis library for java (http://www.jcraft.com/jorbis/).
You could play the wave file as you would normally.
You could also use the FMOD binding in LWJGL, and use this to play modules, midi or ogg vorbis / mp3 (http://puppygames.net/forums/viewtopic.php?t=573)

Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #2 - Posted 2004-06-01 13:41:14 »

>Soundbanks for windows... is this something an end user
>would potentially have to deal with, or has it become part of
>the core distribution since sometime after 1.3?

The JRE comes without a soundbank.

http://java.sun.com/products/java-media/sound/soundbanks.html

Without a soundbank midi and rmf *will* sound like... erm... poo. :-/

>mp3

MP3 isn't really an option. The license fees are pretty high and... well there is OGG. It's free and sounds much nicer - especially with low bitrates. (The Jorbis lib does all those tricky things for you.)

Basically there are two ways then. Either pre-decode into pcm (eg for sound effects) or streaming (decoding of tiny chunks just in time - eg for music). Playback of pre decoded oggs is of course pretty fast (just as wavs), but it needs some ram. Streaming needs more cpu power, but much less ram. However, the usage isn't that high... about 5-10% on a 500mhz machine.

Oh and there is also MOD (a tracker format) you can either playback it with the MicroMod lib or over the fmod lwjgl binding (fmod plays about every audio format).

弾幕 ☆ @mahonnaiseblog
Games published by our own members! Check 'em out!
Try the Free Demo of Revenge of the Titans
Offline DanK

Junior Member




Javver games rock yawel!


« Reply #3 - Posted 2004-06-01 21:24:13 »

jorbis looks pretty promising. I'm trying to keep as few native dependencies in my game as possible so I don't think fmod would be suitable, though I'll have to look at everything in LWJGL a bit closer for my future games.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars and Titan!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (67 views)
2013-05-17 21:29:12

alaslipknot (76 views)
2013-05-16 21:24:48

gouessej (108 views)
2013-05-16 00:53:38

gouessej (104 views)
2013-05-16 00:17:58

theagentd (115 views)
2013-05-15 15:01:13

theagentd (104 views)
2013-05-15 15:00:54

StreetDoggy (149 views)
2013-05-14 15:56:26

kutucuk (172 views)
2013-05-12 17:10:36

kutucuk (170 views)
2013-05-12 15:36:09

UnluckyDevil (179 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.112 seconds with 20 queries.