Try to pass the Id of the post type.
Change
$file = get_attached_media('audio'); To
$file = get_attached_media('audio',get_the_ID());
Try to pass the Id of the post type.
Change
$file = get_attached_media('audio'); To
$file = get_attached_media('audio',get_the_ID());