This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Game Development and the fly likes Audio threading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "Audio threading" Watch "Audio threading" New topic
Author

Audio threading

Wes McClintock
Greenhorn

Joined: Jul 19, 2011
Posts: 25
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: 3900
    
  18

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


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
Wes McClintock
Greenhorn

Joined: Jul 19, 2011
Posts: 25
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: 3900
    
  18

Well, if you give us a better idea of what you want to do, maybe we can give more specific advice.
 
wood burning stoves
 
subject: Audio threading
 
jQuery in Action, 3rd edition