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 Audio threading Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Game Development
Reply Bookmark "Audio threading" Watch "Audio threading" New topic
Author

Audio threading

Wes McClintock
Greenhorn

Joined: Jul 19, 2011
Posts: 21
So, I hope the title isn't misleading, but I'm curious as to how I would go about syncing up some behavior in my game to a certain part of my music. So far the only way I can think of would be to start a thread at the same time as the music that sleeps for 1 second, and then returns the seconds. then, at a certain number of seconds in, the game starts to do whatever. Im curious if theres any other way to do this?
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 2771

You could create a timer and immediately schedule all the happenings, with the first one starting the music.
Wes McClintock
Greenhorn

Joined: Jul 19, 2011
Posts: 21
Stephan van Hulst wrote:You could create a timer and immediately schedule all the happenings, with the first one starting the music.

Im sorry, im very new to this, so im not quite sure what you mean.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 2771

Well, if you give us a better idea of what you want to do, maybe we can give more specific advice.
 
IntelliJ Java IDE
 
subject: Audio threading
 
Threads others viewed
Updating the GUI from 'other' objects - is there a design pattern for this ?
how can I get my game to pause in between rounds?
runs perfectly only from my java\bin dir else errors...
Awkward question (sorry)
Sounds
developer file tools