Friday, 12 November 2021

WAV audio file stored in AWS S3 does not stream in iOS devices

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: enter image description here

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.



from WAV audio file stored in AWS S3 does not stream in iOS devices

No comments:

Post a Comment