문제

I keep getting the LineUnavailableException on line 34 of my code: https://www.refheap.com/21223

The error reads as javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 44100.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian not supported..

I'm creating multiple instances of the Sound class (implemented in my refheap paste). It seems that the first instances have no problem. But when I start making new instances of Sound objects using the same audio file then I start getting this error.

Any idea how to fix it?

EIDT: I think the ByteArrayInputStream idea from this question might be what I need to do, but I'm not sure how yet.

EDIT: I thought I found a solution in this forum thread on how to play the same sound simultaneously, but after changing my code, I still get the same problem. Here's my updated code, but now the error happens on line 88: https://www.refheap.com/21224

도움이 되었습니까?

해결책

I found the solution to the problem: the Beads audio library for Java. Simply amazing.

다른 팁

the exception occurs when you try to open multiple data line at a same time. Second line blocks the opening of first data line.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top