Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (568)
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  
  Help with sound  (Read 2036 times)
0 Members and 1 Guest are viewing this topic.
Offline carti

Junior Newbie




Java games rock!


« Posted 2004-12-15 10:39:44 »

Hi,

Im trying to do a game, and i worked a lot to put the sound in that game.

I read lots of forums, some tips, but still could not do it.

I want to put a backgound music and especial efects when the ship accelerates.

It is a simple game, and i think that is a easy problem.

Please, help me.

tanks

Carti
Offline carti

Junior Newbie




Java games rock!


« Reply #1 - Posted 2004-12-15 11:18:36 »

gotcha
i found the parcial solution in:
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=Sound;action=display;num=1062877058

but the background music still dont work.
now when the games beginning, only the music play and the game not works.

Somebody knows how to play music with a game together?

tanks

Carti
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #2 - Posted 2004-12-15 12:10:28 »

You might want to look at GAGESound. It allows you to play multiple sounds + background MIDI music. All the source code is included for you to peruse. Smiley

Java Game Console Project
Last Journal Entry: 12/17/04
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline carti

Junior Newbie




Java games rock!


« Reply #3 - Posted 2004-12-15 14:48:02 »

jbanes tankyou so muth for the help.

but i´m looking for a something more simple.
Im looking for a single class that i can instace and play, without a lots of things.



carti
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #4 - Posted 2004-12-15 16:10:01 »

*sigh*

Sound:
1  
2  
3  
4  
5  
6  
7  
WaveEngine wave = new WaveEngine()
int sound;

sound = wave.load(getClass().getResource("/mysound.wav"));
wave.play(sound);

while(true) { wave.render();}


Music:
1  
2  
3  
4  
5  
6  
7  
MusicEngine music = new MusicEngine()
int sound;

sound = muic.load(getClass().getResource("/mysound.mid"));
music.play(sound);

while(music.isPlaying()) { Thread.yield();}


I seriously doubt you'll find anything simpler. :-/

Java Game Console Project
Last Journal Entry: 12/17/04
Offline carti

Junior Newbie




Java games rock!


« Reply #5 - Posted 2004-12-16 09:58:36 »

tanks a lot  jbanes

Smiley

Carti
Offline DigitalGhost

Senior Newbie




Java games rock!


« Reply #6 - Posted 2004-12-23 20:56:59 »

Quote
*sigh*

Sound:
1  
2  
3  
4  
5  
6  
7  
WaveEngine wave = new WaveEngine()
int sound;

sound = wave.load(getClass().getResource("/mysound.wav"));
wave.play(sound);

while(true) { wave.render();}


Music:
1  
2  
3  
4  
5  
6  
7  
MusicEngine music = new MusicEngine()
int sound;

sound = muic.load(getClass().getResource("/mysound.mid"));
music.play(sound);

while(music.isPlaying()) { Thread.yield();}


I seriously doubt you'll find anything simpler. :-/


I'm a JAR newbie, how do I add your jar to my project so that I can use your classes and put sound in my game?

If it makes a difference, I'm using Eclipse as my editor.

Thanks for your help =)
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #7 - Posted 2004-12-24 01:20:10 »

Quote
I'm a JAR newbie, how do I add your jar to my project so that I can use your classes and put sound in my game?

If it makes a difference, I'm using Eclipse as my editor.

Thanks for your help =)


Ok. deep breath here:

1. Right click on the project folder
2. Select "Properties"
3. Click on "Java Build Path"
4. Click on "Libraries" tab
5. Click "Add External JARs..."
6. Select "sound.jar" and click OK a few times

You're done. :-)

Java Game Console Project
Last Journal Entry: 12/17/04
Offline DigitalGhost

Senior Newbie




Java games rock!


« Reply #8 - Posted 2004-12-26 00:12:18 »

Quote


Ok. deep breath here:

1. Right click on the project folder
2. Select "Properties"
3. Click on "Java Build Path"
4. Click on "Libraries" tab
5. Click "Add External JARs..."
6. Select "sound.jar" and click OK a few times

You're done. :-)


Awesome!

I haven't used the JAR et, I just put your code into my project, but I'm gonna change it to the jar later.  Your sounds thing works awesome!

You can check it out in the game at http://ucfpawn.homelinux.com/java/twinserpents/client/GameApplet.html

Thanks, bro
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.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (20 views)
2014-09-24 16:12:06

Grunnt (45 views)
2014-09-23 14:38:19

radar3301 (28 views)
2014-09-21 23:33:17

BurntPizza (64 views)
2014-09-21 02:42:18

BurntPizza (33 views)
2014-09-21 01:30:30

moogie (42 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
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!