MediaPlayer的不再是工作,因为R10模拟器? [英] MediaPlayer no longer working on the emulator since r10?
问题描述
protected MediaPlayer _mediaPlayer;
protected void playFromResource(int resId)
{
if (_mediaPlayer != null)
{
_mediaPlayer.stop();
_mediaPlayer.release();
}
_mediaPlayer = MediaPlayer.create(this, resId);
_mediaPlayer.start();
}
这code用于正常工作同时在仿真器和设备上。由于一段时间(我想这是因为我更新到ADT R10),它只能在设备上。在仿真器也没有了声音,当它通过在_mediaPlayer.release申请冻结()
(第二次调用该函数)。我能够保持应用程序由替换停止()
和发布()
按<$ C $轰然C>复位(),但它并没有解决的主要问题:有是在模拟器上没有声音
This code used to work fine on both the emulator and on devices. Since some time (I think it is since I updated to ADT r10) it only works on devices. On the emulator there is no sound anymore and the application freezes when it pass on _mediaPlayer.release()
(the second time the function is called). I was able to keep the application from crashing by replacing the stop()
and release()
by reset()
but it does not solve the main issue: There is no sound on the emulator.
日志文件给我看这些一堆(仅在仿真器)只是在调用启动()
the log file show me a bunch of these (only on the emulator) just after the call to start()
03-09 19:14:30.716:WARN / AudioTrack(34):obtainBuffer超时(是 在CPU挂?)0x1afb8用户= 00001e00,服务器= 00000600
03-09 19:14:30.716: WARN/AudioTrack(34): obtainBuffer timed out (is the CPU pegged?) 0x1afb8 user=00001e00, server=00000600
任何线索????
推荐答案
看起来只像的问题是在我的电脑上。我只是tryed它在另一台计算机,它做工精细。我有一些问题,当我升级到ADT的R10。也许有我的开发设置是错误的。
Looks like the issue is only on my computer. I just tryed it on another computer and it work fine. I had some issues when I upgraded to r10 of ADT. Maybe there is something wrong in my development setup.
这篇关于MediaPlayer的不再是工作,因为R10模拟器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!