Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (578)
games submitted by our members
Games in WIP (499)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  AudioMixer  (Read 7577 times)
0 Members and 1 Guest are viewing this topic.
Offline nsigma
« Reply #30 - Posted 2011-11-10 12:23:55 »

@nsigma: Lag? Largely due to GUI laziness on my part. (Shot myself in the foot?)
...
All in all, my point is that it is dubious to judge lag based solely on a web demo. One doesn't know what the programmer has done via the GUI layer. Better is to ask: is it in the ball park, and thus worth taking a more serious look?

Don't take things too critically!  Grin

I'm just saying that there is some room for improvement, but you're definitely in the ballpark.  However, I doubt any of this is due to your GUI code.  You'd have to do something really 'lazy' for that to make much difference.

Your code for timing events could be improved though - maybe do the initial play() / start() whatever in the actionPerformed() method, and then post subsequent events into a Timer or ScheduledExecutorService.

For one, Java JButtons don't send events until the MouseUp occurs. So the sounds will naturally seem to fall behind the clicks. Maybe I should create MouseDown sensitive "touchpads." (Cranky Have...other...priorities...)

I'm planning on some of those for JAudioLibs (recently been having conversation with another audio developer about adding some useful GUI widgets) but that won't be until the new year.  Like you - other priorities.

However, quick fix for your applet might be to add mouse listeners to the JButtons instead of action listeners, and fire on mousePressed().

We need a smiley icon for "bangs-head-against-wall".

I'm sure we used to have one of those?!

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline philfrei
« Reply #31 - Posted 2011-11-11 08:02:24 »

@nsigma Thanks for the suggestion about attaching a MouseListener to the JButtons. I didn't realize that was an option. Clueless The demo works much better! I also put the starts of the RayGuns prior to the Thread creation. Seems to help. I don't think it would be wise to do this to the Machine gun. Because the timing of the shots needs to be very even, I want it all in one place.

I added an 'Options' MenuBar for picking an output line, in case there is a Linux user or someone else who is having troubles such as we've discussed before with output lines.

The only other red flag was from ra4king. I've confirmed that other people have hit the same issue with Java 7 and backwards compatibility with audio. There's already thread on it at the Oracle Forum for Java Sound. They are calling it a bug and have registered it with Oracle, but I suspect my fix (avoiding using InputStream) is going to be fine. Am awaiting any confirmation that this fix works! Hopefully ra4king tries again or someone else with Java 7 gives the demo a try and let's me know if it works now or not.

"Greetings my friends! We are all interested in the future, for that is where you and I are going to spend the rest of our lives!" -- The Amazing Criswell
Offline ra4king

JGO Kernel


Medals: 322
Projects: 2
Exp: 4 years


I'm the King!


« Reply #32 - Posted 2011-11-11 22:34:24 »

It works now!! Hooray!!! Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline philfrei
« Reply #33 - Posted 2011-11-11 22:44:31 »

Whoo hoo! You made my day.
Now I go to the 6 other forums where I was asking about this and follow up...

"Greetings my friends! We are all interested in the future, for that is where you and I are going to spend the rest of our lives!" -- The Amazing Criswell
Pages: 1 [2]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (28 views)
2014-04-15 18:08:23

BurntPizza (25 views)
2014-04-15 03:46:01

UprightPath (40 views)
2014-04-14 17:39:50

UprightPath (22 views)
2014-04-14 17:35:47

Porlus (38 views)
2014-04-14 15:48:38

tom_mai78101 (62 views)
2014-04-10 04:04:31

BurntPizza (121 views)
2014-04-08 23:06:04

tom_mai78101 (221 views)
2014-04-05 13:34:39

trollwarrior1 (188 views)
2014-04-04 12:06:45

CJLetsGame (195 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!