Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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 2266 times)
0 Members and 1 Guest are viewing this topic.
Offline DanK

Junior Devvie

Javver games rock yawel!

« Posted 2004-06-01 05: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

JGO Knight

Medals: 19
Projects: 1

I'm gonna wring your pants!

« Reply #1 - Posted 2004-06-01 06: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 (
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 (

Offline oNyx

JGO Coder

Medals: 2

pixels! :x

« Reply #2 - Posted 2004-06-01 11: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.

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


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!
Legends of Yore - The Casual Retro Roguelike
Offline DanK

Junior Devvie

Javver games rock yawel!

« Reply #3 - Posted 2004-06-01 19: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  

EgonOlsen (73 views)
2018-06-10 19:43:48

EgonOlsen (54 views)
2018-06-10 19:43:44

EgonOlsen (73 views)
2018-06-10 19:43:20

DesertCoockie (253 views)
2018-05-13 18:23:11

nelsongames (154 views)
2018-04-24 18:15:36

nelsongames (154 views)
2018-04-24 18:14:32

ivj94 (895 views)
2018-03-24 14:47:39

ivj94 (156 views)
2018-03-24 14:46:31

ivj94 (808 views)
2018-03-24 14:43:53

Solater (172 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
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!