AudioTrack: play() called on uninitialized AudioTrack

99封情书 提交于 2019-12-01 03:42:15
MikeHelland

I would think that you need to call play() before you call write().

But I've also noticed that when you create lots of AudioTrack instances even if you think you're cleaning everything up write, sometimes a play() fails to work, and the track is uninitialized.

You will want to try...catch this IllegalStateException, and avoiding calling write() until play() works without throwing an exception.

Why you have commented out your stopPlaying() method?

You can only create 32 AudioTracks. If you want more you should call release() method.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!