• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Placing motion and sound in Java

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
good idea, I am interested too,
 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Today you are you, that is turer than true. There is no one alive who is youer than you! - Seuss. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic