You'll need to register a custom shortcode to be able to output the caption and description, and then use that shortcode where you want them to appear.
You can add the following to Toolset > Settings > Custom Code to register the shortcode 'media-field':
/**
* Register shortcode 'media-field'
*
* Pass URL of media as shortcode content
* Attribute 'output' specifies what to return, defaults to media title
*
* example usage:
* [media-field output='alt']...url here...[/media-field]
*/
add_shortcode('media-field', function ($atts = [], $content = null) {
// provide default
$atts = shortcode_atts(
array(
'output' => 'title',
),
$atts
);
$output = '';
if (isset($content)) {
$url = do_shortcode( $content );
// get the ID of the media post for the URL contained in content
$media_id = attachment_url_to_postid($url);
$media = get_post($media_id);
switch ($atts['output']) {
case 'title':
$output = $media->post_title;
break;
case 'caption':
$output = $media->post_excerpt;
break;
case 'description':
$output = $media->post_content;
break;
case 'alt':
$output = get_post_meta( $media_id, '_wp_attachment_image_alt', true );
break;
}
}
return $output;
});
You need to provide the audio field URL as the shortcode content, e.g.
With an audio custom field, when you add an audio file (e.g. an MP3 file) it is added to the WordPress Media Library, and an attachment post for the file is created which stores the data for description, caption etc. These can be edited within the Media Library.
The audio custom field itself stores the url of the mp3 file.
If you have registered the custom shortcode and it is active then you only need to make sure you are outputting the url of the file within the opening and closing media-field shortcodes. That's what the types shortcode does. Make sure that you edit my example to use your own custom field slug ("mp3-file" in my example).
You can check that the types shortcode is outputting the url as expected by adding just the types shortcode to your template, without the surrounding media-field shortcode.