Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (489)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (555)
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  
  Which Java sound API is the best?  (Read 2240 times)
0 Members and 1 Guest are viewing this topic.
Offline TheAnalogKid

JGO Coder


Projects: 2



« Posted 2004-09-17 11:55:42 »

Hi!

I'm integrating sound/music in MightyBubbles (http://www.myjavaserver.com/~theanalogkid/servlets/app/mighty_bubbles.jnlp) but I don't know which Java API whould be the best for that?

Is Jorbis a good choice?

Thanks for answers!

Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #1 - Posted 2004-09-17 12:40:48 »

Jorbis is "just" a ogg decoder lib. It's unable to playback those decoded pcm bytes.

The involved overhead is about 80kb... so if you got more than a handfull of samples (low quality 8bit/mono/11khz) it might be worth it.

For actual playback you would either use java's (newer) sound stuff, lwjgl's sound stuff (openal), fmod (through lwjgl) or joal.

弾幕 ☆ @mahonnaiseblog
Offline TheAnalogKid

JGO Coder


Projects: 2



« Reply #2 - Posted 2004-09-17 13:37:10 »

I tought someone said that Java Sound sucks concerning performance?

Is that true that ogg files are smaller that mp3 files for the same bit rate? Apart playback performance, my other concern is about file size.

Thanks!

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline BorgKnight

Senior Newbie




Space whales rock!


« Reply #3 - Posted 2004-09-17 15:52:50 »

JavaSound *had* very high-latency sound, the kind that was unacceptable (IMO) for an arcade game. Everything was done in software on Windows prior to Tiger.

Now that the new DirectAudioDevices are returned by the mixers, you can have the same kind of performance (latency-wise) as you would thru DirectSound.

HOWEVER, the JavaSound specs do NOT impose that an implementation support basic controls such as volume changes. Apparently the goal was to provide just a "pure" line to the sound card, nothing more.

What this means is if you want anything more than straight playback and looping, you have to implement your own DSP functions. Yes, even for stupid volume changes, just in case the implementation you're using doesn't support the control. It most likely won't unless you're using JS's non-hardware mixer, the default prior to DirectAudioDevices.

Tritonus.org has some JS-plugins that do the heavy-lifting (especially for volume changes), but you still have to integrate it to your mixing routines. Definitely not a plug-and-play solution.

I implemented by game audio lib a couple of months ago, after looking at the open source alternatives and their deployment/stability issues, I chose JavaSound and I'm still happy with it. I spent a lot of time tho tweaking my mixing routines to avoid any pops/clicks during my sound playback. Beware. I also only play wave files in my game.

I recommend you give a hard look at all other alternatives first.

HTH,
BK

Offline TheAnalogKid

JGO Coder


Projects: 2



« Reply #4 - Posted 2004-09-17 17:06:12 »

Thanks a lot for the very useful hints!

Offline princec

JGO Kernel


Medals: 368
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #5 - Posted 2004-09-17 20:40:03 »

I recommend LWJGL's OpenAL and FMOD support. It's teh b0mb. Really! I use Jorbis with OpenAL and I've got tons of music in my game and sound effects playing. Great stuff.

Cas Smiley

Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #6 - Posted 2004-09-18 01:21:22 »

Quote
[...]
Is that true that ogg files are smaller that mp3 files for the same bit rate? Apart playback performance, my other concern is about file size.[...]


What's heavier one kg feathers or one kg lead? Wink

With the same bitrate both files would be about the same size (xxx bytes per second +/- some bytes for the header).

The benefits of ogg are better sound (especially at low bitrates) and it's royality free (whereas mp3 isn't).

弾幕 ☆ @mahonnaiseblog
Offline TheAnalogKid

JGO Coder


Projects: 2



« Reply #7 - Posted 2004-09-18 10:52:29 »

Quote
I recommend LWJGL's OpenAL and FMOD support. It's teh b0mb. Really! I use Jorbis with OpenAL and I've got tons of music in my game and sound effects playing. Great stuff.

Cas Smiley

ok thanks!

and where do you get those tons of sounds?

Offline princec

JGO Kernel


Medals: 368
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #8 - Posted 2004-09-20 13:01:07 »

I paid for them Smiley Mike Huang did the sounds for about $15 a pop. See http://www.michaelhuang.com.

I'm really glad I did get him to do them - I can easily spend an entire day on one sound effect and still not get anything I like. He just did the lot in over 2 weeks over about 3-4 iterations.

Cas Smiley

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

 

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

The first screenshot will be displayed as a thumbnail.

Nickropheliac (12 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (27 views)
2014-08-22 19:31:30

atombrot (40 views)
2014-08-19 09:29:53

Tekkerue (38 views)
2014-08-16 06:45:27

Tekkerue (34 views)
2014-08-16 06:22:17

Tekkerue (24 views)
2014-08-16 06:20:21

Tekkerue (34 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (47 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!