Skip to content

Commit

Permalink
solve: Undefined index playtime_seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
anuj9196 authored Nov 10, 2018
1 parent f4de00c commit 20b49d8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/MusicCombine.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ private function _getAudioDuration($audio_path)

$file = $getID3->analyze($audio_path);

// Return 0 (minimum value for audio duration) if playtime_seconds does not exists.
if (!key_exists('playtime_seconds', $file)) {
return 0;
}

$duration = $file['playtime_seconds'];

return $duration;
Expand Down

0 comments on commit 20b49d8

Please sign in to comment.