PlayN Sound:请求的缓冲区太大

发布于 2024-12-29 15:31:40 字数 418 浏览 0 评论 0原文

我正在尝试在 PlayN 中播放声音。

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

但得到这个

无法打开声音sounds/soundtrack.mp3
javax.sound.sampled.LineUnavailableException:无法分配剪辑数据:请求的缓冲区太大。

该怎么办?

这是一个 mp3,时长 6 分 02 秒。 1.09Mb

有效负载大小:1087776 字节
标头位于:2264 字节
编码延迟:576,零填充:824
时长:362秒
MPEG-2.5 第 3 层
24 kbps,5036 帧
8000 Hz 联合立体声

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

远山浅 2025-01-05 15:31:40

据我所知,文件大小限制(这就是您所遇到的)是声音在 Java 后端实现方式的限制。好消息是 HTML 后端应该可以正常播放音频,只是在使用 JRE 本地测试应用程序时您将听不到它。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文