Ik laad mijn mp3 via een pad in de soundpool. Om redenen die ik niet wil bespreken, wil ik niet laden via R.raw
...
Maar ik krijg de foutmelding:
play(int, float, float, int, int, float) in the type SoundPool is not applicable for the arguments (Object, float, float, int, int, float)
Is er een manier om het object te converteren naar een int
?
SoundPool mySoundPool = new SoundPool(1, AudioManager.STREAM_MUSIC, 0);
HashMap mySoundPoolMap = new HashMap();
mySoundPoolMap.put(0, mySoundPool.load("android.resource://com.App.Notifications/raw/myMP3",1));
float streamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
streamVolume = streamVolume/mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
mySoundPool.play(mySoundPoolMap.get(0), streamVolume, streamVolume, 1, 0, 1f);