Question

I'm trying to play a sound in PlayN.

Sound soundtrack = assetManager().getSound("sounds/soundtrack");

But get this

Failed to open sound sounds/soundtrack.mp3
javax.sound.sampled.LineUnavailableException: Failed to allocate clip data: Requested buffer too large.

What to do?

It's an mp3, 6:02 minutes long. 1.09Mb

Payload Size: 1087776 bytes
Header found at: 2264 bytes
Enc Delay: 576, Zero Padding: 824
Length: 362 seconds
MPEG-2.5 layer 3
24 kbps, 5036 frames
8000 Hz Joint Stereo

Was it helpful?

Solution

As far as I can tell the file size limitation (which is what you are hitting) is a limitation of the way that sound is implemented on the Java backend. The good news is that the HTML backend should play the audio fine, you just won't be able to hear it when testing the application locally using the JRE.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top