重用 AudioTrack 实例
我们在 AudioTrack 类中遇到了内存泄漏 (http://code.google.com/p/android/issues/detail?id=17995)
是否有办法重用具有不同波形数据的 AudioTrack 实例? AudioTrack 需要处于静态模式以实现低延迟。
我们基本上希望分配(例如)16 个 AudioTrack 实例,并在播放某些声音效果时重新使用它们。问题似乎是写入已使用的 AudioTrack 会导致崩溃,即使 AudioTrack 已停止也是如此。
有人愿意帮忙吗?我想做的事情可能吗?
谢谢你,
史蒂夫。
We've encountered the memory leak in the AudioTrack class (http://code.google.com/p/android/issues/detail?id=17995)
Is there anyway to re-use AudioTrack instances with different waveform data?
The AudioTracks need to be in static mode for low latency.
We basically want allocate (for example) 16 AudioTrack instances and re-use them whenever we play some sound-fx. The problem seems to be writing to an AudioTrack that has been used causes a crash, even if the AudioTrack has been stopped.
Anyone care to help up out please? Is what I'm trying to do even possible?
Thank you,
Steve.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您尝试使用有限数量的曲目,您是否尝试过使用静态模式?来自@Steve Haggerty的评论:据报道,某些版本的Android存在内存泄漏,STREAM模式将被取消所有开发工作的首选。
If you are trying to use a limited number of tracks have you tried using static mode?From @Steve Haggerty's comment below: there is reportedly a memory leak in certain versions of Android, and STREAM mode is to be preferred for all development work.