逻辑是这样的,
手机卫士里面有个手机防盗的功能,
在接收到#*alarm*#报警指令后,调用
MediaPlayer palyer = MediaPlayer.create(context, R.raw.e);
palyer.setVolume(1.0f, 1.0f);
palyer.start();
abortBroadcast();
进行报警音乐的播放,
从代码上看,没有问题,可是模拟器就是不播放声音.
控制台报出:
04-29 07:05:38.889: D/AudioSink(34): bufferCount (4) is too small and increased to 12
04-29 07:05:58.159: WARN/AudioTrack(34): obtainBuffer timed out (is the CPU pegged?) 0xf508 user=00001a1f, server=00000000

关键字: obtainBuffer timed out .

经过研究,这是模拟器的一个bug, 在开启模拟器的snapshot后,mediaplayer就不能正常使用了.
禁用掉snapshot后,解决这个问题.