diff --git a/src/main/java/org/dstadler/audio/player/TarsosDSPPlayer.java b/src/main/java/org/dstadler/audio/player/TarsosDSPPlayer.java index 919db96..cea97db 100644 --- a/src/main/java/org/dstadler/audio/player/TarsosDSPPlayer.java +++ b/src/main/java/org/dstadler/audio/player/TarsosDSPPlayer.java @@ -36,13 +36,14 @@ public TarsosDSPPlayer(InputStream stream) { @Override public void setOptions(String options) { if(StringUtils.isNotEmpty(options)) { + float prevTempo = tempo; tempo = Float.parseFloat(options); Preconditions.checkState(tempo > 0, "Cannot play at speed zero or less, but had: %s", tempo); // if already playing, pass on the new parameters to allow to change tempo at runtime - if (wsola != null) { + if (wsola != null && prevTempo != tempo) { wsola.setDispatcher(dispatcher); wsola.setParameters(WaveformSimilarityBasedOverlapAdd.Parameters.musicDefaults(tempo, sampleRate)); }