Sound mixing in Java?

How can I play the same sound more than once at any given time, when many other sounds are happening at the same time? Right now I have a clip game, but it will not overlap with itself. (I hear one bullet fire, the sound ends, then it plays again). I am writing a game with a fast bullet shooting system, but I cannot get the sound to work well. It just doesn't sound “right” to hear only one bullet shot every half second, when you show 20+ on the screen every second.

Any help? Pointers ?: D

+3
source share
3 answers

This seems to answer your question:

http://my.safaribooksonline.com/9781598634761/ch09lev1sec3

:

" , Clip , . , , , . [...] , ( ): 1) Clip (, ), . , , , , ".

, , Java , .

+1

20 . . , 7 , ( 3 4 ), , 100 5- . .

Clips , , RAM. , . - . .

myClip.stop();
myClip.setFramePosition(0);
myClip.start();

. , . , .

+1

AudioClip , - , .wav, .

0
source

Source: https://habr.com/ru/post/1706162/


All Articles