Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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  
  Sound in Java  (Read 4521 times)
0 Members and 1 Guest are viewing this topic.
Offline philfrei
« Reply #30 - Posted 2011-05-09 08:26:20 »

Cool! I wish I could hear some of what you are up to. I'm not clear on what you are thinking of in terms of a boolean. I'm also not sure I want to invest a lot more time in this until I get it working with some sort of compressed sound as input.

"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 Christopher

Senior Member


Medals: 2
Projects: 1



« Reply #31 - Posted 2011-05-09 13:39:32 »

Cool! I wish I could hear some of what you are up to. I'm not clear on what you are thinking of in terms of a boolean. I'm also not sure I want to invest a lot more time in this until I get it working with some sort of compressed sound as input.


I just mean you can spam the play button on your app and it plays multiple times (not sure if you wanted this feature or not?). I have been using slick for my sound, but im sure there is something similar to,

1  
2  
3  
if(music.isPlaying())
playButton = notClickable;
yalpButton = notClickable;



Offline philfrei
« Reply #32 - Posted 2011-05-09 18:12:01 »

It was deliberate. I purposely wrote the code so that it could handle overlapping playbacks: each is launched in its own thread. I see an earlier post where you wrote of problems calling code that does playback when a play was already in progress, and you use a boolean to prevent this. The boolean could also be used in that context to stop and reset the sound, restart from the beginning. But I find it generally annoying when sounds are cut off prematurely. I want them to at least tail off in a natural fashion, and this requires overlap--thus, separate threads.

The total number of overlapping plays possible will be limited by how much RAM you have available. But when I had an early "windchime" experiment up on JConsole, I found I could get like 100 simultaneous wav files playing at the same time in one app. The background "windchime" in Hexara has a random factor, but between the background pad and triggered sounds and the background chimes, it will often have something like 10 sounds playing at once.

"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
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Christopher

Senior Member


Medals: 2
Projects: 1



« Reply #33 - Posted 2011-05-10 00:47:13 »

Yes! This style of plug-in would be perfect for generating a wind chime sound on the fly.

Offline counterp

Senior Member


Medals: 11



« Reply #34 - Posted 2011-05-11 04:53:05 »

(don't forget that your sound thread should have a high priority, just my 2 cents)
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.

BurntPizza (25 views)
2014-09-19 03:14:18

Dwinin (39 views)
2014-09-12 09:08:26

Norakomi (68 views)
2014-09-10 13:57:51

TehJavaDev (93 views)
2014-09-10 06:39:09

Tekkerue (47 views)
2014-09-09 02:24:56

mitcheeb (68 views)
2014-09-08 06:06:29

BurntPizza (51 views)
2014-09-07 01:13:42

Longarmx (38 views)
2014-09-07 01:12:14

Longarmx (44 views)
2014-09-07 01:11:22

Longarmx (40 views)
2014-09-07 01:10:19
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!