在Android 4.0中播放声音时出错,但此代码适用于2.3.3
mp = new MediaPlayer();
mp.setDataSource(recordedSoundFilePath);
mp.prepare();
mp.start();
错误日志
02-21 05:42:44.542: E/MediaPlayer(4768): error (1, -2147483648)
02-21 05:42:44.550: E/MediaPlayer(4768): Error (1,-2147483648)
02-21 05:42:44.550: D/MediaPlayer(4768): Info (1,-2147483648)
提前致谢。
答案 0 :(得分:0)
{final FileInputStream i = openFileInput("local file name with no /s");
player.setDataSource(i.getFD());
i.close();
}