Android播放器继续callback,缓冲

我正在使用MediaPlayer从我的应用中的在线mp3文件播放一些声音。

但是,即使播放完成后,我仍然在控制台中获得线路和callback和缓冲。

 10-24 08:08:48.467 19221-19233/com.myapp V/MediaPlayer﹕ callback application 10-24 08:08:48.467 19221-19233/com.myapp V/MediaPlayer﹕ back from callback 10-24 08:08:49.468 19221-19232/com.myapp V/MediaPlayer﹕ message received msg=3, ext1=100, ext2=0 10-24 08:08:49.468 19221-19232/com.myapp V/MediaPlayer﹕ buffering 100 10-24 08:08:49.468 19221-19232/com.myapp V/MediaPlayer﹕ callback application 10-24 08:08:49.468 19221-19232/com.myapp V/MediaPlayer﹕ back from callback 10-24 08:08:50.469 19221-19233/com.myapp V/MediaPlayer﹕ message received msg=3, ext1=100, ext2=0 10-24 08:08:50.469 19221-19233/com.myapp V/MediaPlayer﹕ buffering 100 10-24 08:08:50.469 19221-19233/com.myapp V/MediaPlayer﹕ callback application 10-24 08:08:50.469 19221-19233/com.myapp V/MediaPlayer﹕ back from callback 10-24 08:08:51.470 19221-19232/com.myapp V/MediaPlayer﹕ message received msg=3, ext1=100, ext2=0 10-24 08:08:51.470 19221-19232/com.myapp V/MediaPlayer﹕ buffering 100 10-24 08:08:51.470 19221-19232/com.myapp V/MediaPlayer﹕ callback application 10-24 08:08:51.470 19221-19232/com.myapp V/MediaPlayer﹕ back from callback 10-24 08:08:52.471 19221-19233/com.myapp V/MediaPlayer﹕ message received msg=3, ext1=100, ext2=0 10-24 08:08:52.471 19221-19233/com.myapp V/MediaPlayer﹕ buffering 100 10-24 08:08:52.471 19221-19233/com.myapp V/MediaPlayer﹕ callback application 10-24 08:08:52.471 19221-19233/com.myapp V/MediaPlayer﹕ back from callback 10-24 08:08:53.472 19221-19232/com.myapp V/MediaPlayer﹕ message received msg=3, ext1=100, ext2=0 10-24 08:08:53.472 19221-19232/com.myapp V/MediaPlayer﹕ buffering 100 10-24 08:08:53.472 19221-19232/com.myapp V/MediaPlayer﹕ callback application 10-24 08:08:53.472 19221-19232/com.myapp V/MediaPlayer﹕ back from callback 10-24 08:08:54.473 19221-19233/com.myapp V/MediaPlayer﹕ message received msg=3, ext1=100, ext2=0 10-24 08:08:54.473 19221-19233/com.myapp V/MediaPlayer﹕ buffering 100 10-24 08:08:54.473 19221-19233/com.myapp V/MediaPlayer﹕ callback application 10-24 08:08:54.473 19221-19233/com.myapp V/MediaPlayer﹕ back from callback 10-24 08:08:55.473 19221-19232/com.myapp V/MediaPlayer﹕ message received msg=3, ext1=100, ext2=0 10-24 08:08:55.473 19221-19232/com.myapp V/MediaPlayer﹕ buffering 100 10-24 08:08:55.473 19221-19232/com.myapp V/MediaPlayer﹕ callback application 10-24 08:08:55.473 19221-19232/com.myapp V/MediaPlayer﹕ back from callback 10-24 08:08:56.474 19221-19233/com.myapp V/MediaPlayer﹕ message received msg=3, ext1=100, ext2=0 10-24 08:08:56.474 19221-19233/com.myapp V/MediaPlayer﹕ buffering 100 10-24 08:08:56.474 19221-19233/com.myapp V/MediaPlayer﹕ callback application 10-24 08:08:56.474 19221-19233/com.myapp V/MediaPlayer﹕ back from callback 10-24 08:08:57.475 19221-19232/com.myapp V/MediaPlayer﹕ message received msg=3, ext1=100, ext2=0 

我尝试过在播放器上调用stop() ,但是这只能防止播放器正常播放。

我能做什么?

Solutions Collecting From Web of "Android播放器继续callback,缓冲"

你确定没有别的东西在背景中运行吗(像潘多拉)?

我发现你的问题,因为我的机器人产生相同的logcat消息。 然后我意识到我的潘多拉的应用程序已经暂停,结束了应用程序的消息停止。

嘿,我也发现在我的情况。

尝试添加一个OnCompletionListener。

voicePlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mp) { mp.stop(); mp.reset(); } });