So, I am not a PHP expert, but I found this link https://www.sermonbrowser.com/forum/suggestions/amazon-s3-streaming/ that gives an alternative line of code that seems to work for me:
$tempfilename = $sermonUploadDir.substr(str_shuffle(“abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789”), 0, 8).’.mp3′;