Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Java Codes or Libraries for In-Game Sounds  (Read 673 times)
0 Members and 1 Guest are viewing this topic.
Offline olingalan

JGO n00b
*

Posts: 5



« on: 2012-01-31 02:59:57 »

Hi guys! I'm a computer science student and my partner(in thesis) and I are developing a game ung JAVA NETBEANS IDE...

We wonder if u can help us out in choosing or giving us hint on how we can put sounds or sound effects in our game..

Asking for codes or libraries or programming guides here.. tnx guys! more power!
Offline krasse

Sr. Member
**

Posts: 286
Medals: 14



« Reply #1 on: 2012-01-31 03:43:04 »

BFXR is a nice SFX generator:
http://www.bfxr.net/

I have ported its predecessor, SFXR, to Java if you want to have the effects generated within the game:
http://www.springworldgames.com/sfxrjava/

Offline ra4king

JGO Kernel
*****

Posts: 3155
Medals: 196


I'm the King!


« Reply #2 on: 2012-01-31 04:06:56 »

Adding sounds is a simple 3 lines of code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;

...

AudioInputStream in = AudioSystem.getAudioInputStream(getClass().getResource("relative/path/to/sound.wav"));
Clip clip = AudioSystem.getClip();
clip.open(in);


Then you can call Clip's methods to play, stop, loop, etc..

Note, Java only supports WAV, AIFF, and AU.

Games published by our own members! Go get 'em!
Offline Cero

JGO Neuromancer
****

Posts: 1050
Medals: 18



« Reply #3 on: 2012-01-31 10:14:21 »

HEY WHATS UP WITH YOUR CAPS LOCK, IN EVERY DAMN THREAD THAT YOU CREATE
I THINK ITS RATHER RUDE

Offline Regenuluz

Jr. Member
**

Posts: 73
Medals: 1



« Reply #4 on: 2012-01-31 10:19:44 »

HEY WHATS UP WITH YOUR CAPS LOCK, IN EVERY DAMN THREAD THAT YOU CREATE
I THINK ITS RATHER RUDE

+1

I was just commenting on this to my gf, so mental highfive. ^_^
Offline sproingie

JGO Strike Force
***

Posts: 897
Medals: 55



« Reply #5 on: 2012-01-31 12:07:04 »

Please don't use CAPS LOCK for your post titles.  Also, while we're happy to help members of the community, we are not free tech support who will simply provide documentation dumps for which a few minutes of using Google would also suffice.

Online teletubo
« League of Dukes »

Sr. Member
*****

Posts: 463
Medals: 17



« Reply #6 on: 2012-01-31 12:16:53 »

http://www.java-gaming.org/topics/3d-sound-engine/20271/view.html

Paulscode's 3d sound system is my favourite.

Offline gouessej

JGO Kernel
*****

Posts: 3560
Medals: 30


TUER


« Reply #7 on: 2012-01-31 13:10:39 »

Adding sounds is a simple 3 lines of code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;

...

AudioInputStream in = AudioSystem.getAudioInputStream(getClass().getResource("relative/path/to/sound.wav"));
Clip clip = AudioSystem.getClip();
clip.open(in);


Then you can call Clip's methods to play, stop, loop, etc..

Note, Java only supports WAV, AIFF, and AU.
The high-level part of the JavaSound API works badly with OpenJDK  Sad

http://www.java-gaming.org/topics/3d-sound-engine/20271/view.html

Paulscode's 3d sound system is my favourite.
Mine too. Paul Lamb Sound Library supports the main sound formats and works both with OpenAL and JavaSound.

Julien Gouesse
Offline olingalan

JGO n00b
*

Posts: 5



« Reply #8 on: 2012-02-02 05:14:34 »

tnx for helping me out guys.. i'm so sorry.. i'm a newbie here in java-gaming.org.... never gonna happen again  Wink
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.111 seconds with 20 queries.