音频在 Android 平台上无法使用 playn 工作
playn 的 android 后端音频是否正常工作?
我最近尝试了我制作的演示,它没有播放任何声音。
这种情况发生在 android 后端,html 和 java 可以正常播放声音。
我正在使用 mp3 文件。
Is audio working in the android backend of playn?
I recently tried a demo I made, and it didn't play any sound.
This is happening just in the android backend, html and java are playing the sounds just fine.
I'm using mp3 files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的。
在我的 Android 环境中听起来工作正常,但在 Java 中却不起作用 - 悖论。
我的代码:
我的路径中有音频文件:
检查是否未将 .mp3 od .wav 添加到 getSound 方法。
检查子文件夹 /resources/ 中是否有未在 getSound 方法中写入的文件。
Yes.
Sounds work fine in my case for Android, but it doesn't work in Java - paradox.
My code:
I have audio files in path:
Check if you dont add .mp3 od .wav to getSound method.
Check if you have files in subfolder /resources/ which is not writen in getSound method.
在这里他们告诉我们,声音部分实现,它是真实的。
对我来说,
PlayN.audio()
有时有效,有时无效,有时当您尝试关闭 Activity 时,它会出现不可见的内存泄漏和崩溃,因此对于 PlayN Android 部分,我实现了自己的 SoundPool (播放*.ogg)。它比MediaPlayer更简单、更稳定。很好的工作示例这里并且效果很好。
对于 Java 平台 PlayN.audio() 工作正常。
Here they told, that sound implemented partially, it is real.
For me
PlayN.audio()
sometimes works some time doesn't, and some times it has invisible memmory leaks and crashes when you trying to close activity, so for PlayN Android part I implemented my own SoundPool (plays *.ogg). It's much more simply and stable than MediaPlayer.Good working example here and it works perfectly.
For Java Platform PlayN.audio() works fine.