|
|
|
@ -295,8 +295,10 @@ public class AndroidAudioRenderer implements AudioRenderer, |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void onCompletion(MediaPlayer mp) { |
|
|
|
|
if (mp.isPlaying()) { |
|
|
|
|
mp.seekTo(0); |
|
|
|
|
mp.stop(); |
|
|
|
|
} |
|
|
|
|
// XXX: This has bad performance -> maybe change overall structure of
|
|
|
|
|
// mediaplayer in this audiorenderer?
|
|
|
|
|
for (AudioNode src : musicPlaying.keySet()) { |
|
|
|
@ -305,6 +307,7 @@ public class AndroidAudioRenderer implements AudioRenderer, |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -342,9 +345,15 @@ public class AndroidAudioRenderer implements AudioRenderer, |
|
|
|
|
if (channel == 0) { |
|
|
|
|
soundpoolStillLoading.put(audioData.getId(), src); |
|
|
|
|
} else { |
|
|
|
|
if (src.getStatus() != Status.Stopped) { |
|
|
|
|
soundPool.stop(channel); |
|
|
|
|
src.setStatus(Status.Stopped); |
|
|
|
|
} |
|
|
|
|
src.setChannel(channel); // receive a channel at the last
|
|
|
|
|
setSourceParams(src); |
|
|
|
|
// playing at least
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
logger.log(Level.SEVERE, |
|
|
|
@ -413,7 +422,7 @@ public class AndroidAudioRenderer implements AudioRenderer, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setSourceParams(AudioNode src, MediaPlayer mp) { |
|
|
|
|
mp.setLooping(true); |
|
|
|
|
mp.setLooping(src.isLooping()); |
|
|
|
|
mp.setVolume(src.getVolume(), src.getVolume()); |
|
|
|
|
//src.getDryFilter();
|
|
|
|
|
} |
|
|
|
|