Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (780)
Games in Android Showcase (233)
games submitted by our members
Games in WIP (856)
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 23490 times)
0 Members and 1 Guest are viewing this topic.
Offline nsigma
« Reply #30 - Posted 2011-11-10 11: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 - hybrid visual IDE for (live) creative coding
Offline philfrei
« Reply #31 - Posted 2011-11-11 07: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.

music and music apps:
Offline ra4king

JGO Kernel

Medals: 508
Projects: 3
Exp: 5 years

I'm the King!

« Reply #32 - Posted 2011-11-11 21: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 21: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...

music and music apps:
Pages: 1 [2]
  ignore  |  Print  

hadezbladez (728 views)
2018-11-16 13:46:03

hadezbladez (363 views)
2018-11-16 13:41:33

hadezbladez (715 views)
2018-11-16 13:35:35

hadezbladez (179 views)
2018-11-16 13:32:03

EgonOlsen (2375 views)
2018-06-10 19:43:48

EgonOlsen (2528 views)
2018-06-10 19:43:44

EgonOlsen (1466 views)
2018-06-10 19:43:20

DesertCoockie (2132 views)
2018-05-13 18:23:11

nelsongames (1928 views)
2018-04-24 18:15:36

nelsongames (2601 views)
2018-04-24 18:14:32
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 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‑
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!