媒体播放器错误(-19,0​​)反复播放后, [英] Mediaplayer error (-19,0) after repeated plays

查看:112
本文介绍了媒体播放器错误(-19,0​​)反复播放后,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个游戏中,当一个级别是完成一个声音播放。一切工作正常下手,但重复10级或20倍的logcat突然报告后: MediaPlayer的错误(-19,0​​)和/或媒体播放器开始调用状态0,声音不再进行。

I have a game in which a sound plays when a level is completed. Everything works fine to start with but after repeating a level 10 or 20 times the logcat suddenly reports: "MediaPlayer error (-19,0)" and/or "MediaPlayer start called in state 0" and the sounds are no longer made.

我本来MP3格式的所有声音,但是,读了OGG可能更可靠的售后服务,我转换他们都OGG,但出现错误一样。

I originally had the all sounds in mp3 format but, after reading that ogg may be more reliable, I converted them all to ogg, but the errors appeared just the same.

任何想法如何,我可以解决这个问题?

Any idea how I can fix this problem?

推荐答案

我觉得你的不释放您使用播放声音的mediaplayers .. 你需要释放()的媒体播放器,否则资源不释放,你很快就会出现内存不足(因为你分配他们下次再来)。所以,我觉得你可以玩两次,甚至三次......但没有多少时间,而释放资源

I think you are not releasing the mediaplayers you are using to play the sound.. You need to release() the media players otherwise the resources are not released , and you soon get out of memory (since you allocate them again next time). so,I think you can play twice or even thrice... but not many times without releasing the resources

这篇关于媒体播放器错误(-19,0​​)反复播放后,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆