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.
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.
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
posted 12 years ago
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.
Studying for SCJP 6
posted 12 years ago
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.