$page->audio()
Filters the Files collection by type audio
$page->audio(): Files
Return type
Parent class
What is an audio file?
Kirby considers the following file types as audio files:
- aif
- aiff
- flac
- m4a
- midi
- mp3
- oga
- ogg
- opus
- wav
- weba
Examples
<h2>Songs</h2>
<?php foreach($page->audio() as $audio): ?>
<audio controls>
<source src="<?= $audio->url() ?>" type="<?= $audio->mime() ?>">
</audio>
<?php endforeach ?>