My application stores .wav
audio files in AWS S3. Links to these audio files are shared to the users and these audio files failed to play in iOS devices. I have tested this across multiple browsers like Brave, Chrome and Safari in iOS devices and the issue is persistent. However, the audio files play without any issue in Mac OS and Android devices. This proves that the audio files are indeed playable and not corrupted.
When I try to play the audio in iOS devices the screen appears to be as follows:
I am not sure how to debug this issue since there is not much info on Google. Any pointers on how to go about fixing this issue is greatly appreciated.
Update As requested I am providing the example code
Function uploading audio file to S3:
fun putAudioObject(key: String, file: File) {
try {
logger.info("Saving file: $key")
// client here is AmazonS3 client from Java SDK for AWS
client.putObject(bucket, key, file)
} catch (e: Exception) {
logger.error("Failed to put object with key: $key to bucket: $bucket. Error: ${e.message}")
throw ExternalServiceException("S3", e)
}
There is no meta data added unfortunately. But I checked the S3 console, each object has an autogenerated content-type: audio/x-wav
added.