Checks if there are any audio files in the page's directory

  • return (integer)


echo $page->hasAudio(); //returns the number of audio files in the folder

if($page->hasAudio()) {
  $audio = $page->audio();

What is an audio file?

Kirby considers the following file types as audio files:

  • mp3
  • m4a
  • wav
  • aif
  • aiff
  • midi

Is something missing or incorrect? Edit this page on Github…