Display Audio Attachment URL

Assuming you do know the attachment $id, you can use wp_get_attachment_url():

  • <?php wp_get_attachment_url( $id ); ?>

If you need to determine the attachment $id, you can use get_posts():

global $post;
$audio_attachments = get_posts( array(
    'post_parent' => $post->ID,
    'post_type' => 'attachment',
    'post_mime_type' => 'audio'
) );

If you have multiple (or unknown number of) audio attachments, you can loop through to get the URLs:

$audio_attachment_urls = array();

foreach ( $audio_attachments as $audio_attachment ) {
    $audio_attachment_urls[] = wp_get_attachment_url( $audio_attachment->ID );
}

Or, if you know there is only one audio attachment:

$audio_attachment_url = wp_get_attachment_url( $audio_attachments[0]->ID );