File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Game Development and the fly likes Placing motion and sound in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "Placing motion and sound in Java" Watch "Placing motion and sound in Java" New topic
Author

Placing motion and sound in Java

Jeff Klamer
Greenhorn

Joined: May 26, 2007
Posts: 7
A friend has created a game using Java for me. How can he place sound and motion behind the object he has created? I would like to place a rolling river or the ocean moving in the background with sound.

Thank you,
jeffphotos
arobert smith
Greenhorn

Joined: Jun 13, 2007
Posts: 1
good idea, I am interested too,


<a href="http://www.softsea.com/" target="_blank" rel="nofollow">software reviews</a>
Eric Daly
Ranch Hand

Joined: Jul 11, 2006
Posts: 143
Hey, I'm just a beginner, but actually I just started an interest in the Java sound API, so maybe I could help with that aspect. You're asking for two different things though, audio and graphics. Java can play back sound, either a MIDI file or some kind of "sampled audio" like a .wav or .mp3 (I'm not sure if that's out of the box or if you have to have plugins for different audio formats). Anyway, maybe you can clarify if you want to play some sort of ocean video in the background, or if you want to generate an ocean simulation graphically. Video is probably easier. And for sound, it should be pretty simple, you can have a sound play back at a certain event, or a constant "song" or ocean noise or whatever in the background simultaneously.
Really I'm just rambling, maybe stirring up some questions you might have... give us some more information, this will be an interesting project.


Studying for SCJP 6
colin shuker
Ranch Hand

Joined: Apr 11, 2005
Posts: 744
Hi Eric, I'm the person Jeff mentioned who is building the project.

Essentially its a rubiks cube with images drawn inside a JPanel,
we would like to somehow play a movie in the background of the JPanel.

One way would be to have several images that loop, and then just repaint
them one at a time, but my concern is the amount of work the cpu has to
do on top of what it already does with the calculations and the repainting
the cube itself.

I think this would be a bit of a drag on the cpu, and would be awful for
users with less powerful computers.

I don't know if its possible to play an actual movie clip in the JPanel,
seems like a difficult thing to set up.

Would like to use sound too, but when JARing the application from eclipse,
executing the JAR file on desktop caused difficulties playing the sound
files, but I know it works fine on applets.

Any thoughts? Thanks
Eric Daly
Ranch Hand

Joined: Jul 11, 2006
Posts: 143
Sorry I've taken so long to reply.
I'm just getting into packaging and JARs and whatnot, so I will have to test out some stuff. I may be of no help at all though, because this is all pretty new to me.
When I get time I'll see if I can make a simple JPanel that plays back a video with sound and execute it from a JAR. I'll get back to you as soon as I can.
Jeff Klamer
Greenhorn

Joined: May 26, 2007
Posts: 7
Hi Eric-thanks for your reply. I just got back from a one-week trip. Yes, if you can do what you wrote about and Colin can place the "FotoCube" on top of a simple video background (such as the ocean rolling, or moonlight on the rolling ocean, or a rolling river, with sound being available that is what I am trying to create.

Things are pretty tight for me right now financially. I am paying Colin as I can for the work he does for me-we have an arrangement. If you are able to put the video and sound capabilities together with our "FotoCube" I would certainly commit to paying you an appropriate amount as soon as I am able to do that.

Thank you again for your reply.

Sincerely,
Jeff Klamer

www.jeffklamerdesign.com
www.animatedjigsaws.com
(831) 625-1704
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Placing motion and sound in Java