Skip to content

Commit

Permalink
Update MusicCombine.php
Browse files Browse the repository at this point in the history
fixes tempo duration
  • Loading branch information
anuj9196 authored Nov 10, 2018
1 parent aa9f873 commit f4de00c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/MusicCombine.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,20 @@ private function _getAudioSpeed($time_gap, $audio_duration)
}

if ($number_of_seconds_to_append > 0) {
$tempo .= 'atempo='.$number_of_seconds_to_append;
if ($number_of_seconds_to_append >= 0.5) {
$tempo .= 'atempo='.$number_of_seconds_to_append;
} else {
$tempo .= 'atempo=0.5';
}
} else {
$tempo = rtrim($tempo, ',');
}
} else {
$tempo .= 'atempo='.$speed_required;
if ($speed_required < 0.5) {
$tempo .= 'atempo=0.5';
} else {
$tempo .= 'atempo=' . $speed_required;
}
}

return $tempo;
Expand Down

0 comments on commit f4de00c

Please sign in to comment.