Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (688)
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 1703 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  
You cannot reply to this message, because it is very, very old.

Dwinin (74 views)
2015-11-07 13:29:08

Rems19 (81 views)
2015-10-31 01:36:56

Rems19 (79 views)
2015-10-31 01:32:37

williamwoles (107 views)
2015-10-23 10:42:59

williamwoles (93 views)
2015-10-23 10:42:45

Jervac_ (112 views)
2015-10-18 23:29:12

DarkCart (137 views)
2015-10-16 00:58:11

KaiHH (118 views)
2015-10-11 14:10:14

KaiHH (158 views)
2015-10-11 13:26:18

BurntPizza (173 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 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!