Hi @fanlokbun
You could make use of a conditional on this line to check if a value exists:
$file = get_sub_field('voice_recording');
if($file){
$story_audio .='<a href="'. $file['url'].'" target="_blank">'.$file['title'].'</a></br>';
//set all the logic within this
}