AudioFlinger无法创建曲目,状态:-22

Roy*_*ley 5 audio android playback

我正在尝试使用SoundPool类播放mp3文件:


SoundPool文件


我遇到了上述错误.mp3在我的机器上运行正常 - Win7 64bit.错误消息逐字:

09-11 20:27:55.256:E/AudioTrack(671):AudioFlinger无法创建曲目,状态:-22

编辑

执行所述功能的所有代码:

private SoundPool soundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 100);;
private HashMap<Integer, Integer> soundsMap = new HashMap<Integer, Integer>();
private int CLICK_SOUND = 1;



int sp = soundPool.load(this, R.raw.click, 1);
soundsMap.clear();
soundsMap.put(CLICK_SOUND, sp);


AudioManager mgr = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
float streamVolumeCurrent = mgr.getStreamVolume(AudioManager.STREAM_MUSIC);
float streamVolumeMax = mgr.getStreamMaxVolume(AudioManager.STREAM_MUSIC);          
float volume = streamVolumeCurrent / streamVolumeMax;           
soundPool.play(soundsMap.get(sound), volume, volume, 1, 0, fSpeed);
Run Code Online (Sandbox Code Playgroud)