Unable to upload recording of more than 15 mins to AWS server

Hi There, I am trying to record a meeting and upload it to AWS server. The recording is in .m4a format and the upload request is a URLSession request. The following code works perfectly for recordings less than 15 mins. But then for greater recordings, it gets stuck Could you please help me out in this?

func startRecording() {
        let audioURL = getAudioURL()
        
        let audioSettings = [
            AVFormatIDKey: Int(kAudioFormatMPEG4AAC),
            AVSampleRateKey: 12000,
            AVNumberOfChannelsKey: 1,
            AVEncoderAudioQualityKey: AVAudioQuality.high.rawValue
        ]
        do {
            audioRecorder = try AVAudioRecorder(url: audioURL, settings: audioSettings)
            audioRecorder.delegate = self
            audioRecorder.record()
        } catch {
            finishRecording(success: false)
        }
    }

func uploadRecordedAudio{
            let _ = videoURL.startAccessingSecurityScopedResource()
            let input = UploadVideoInput(signedUrl: signedUrlResponse, videoUrl: videoURL, fileExtension: "m4a")
            self.fileExtension = "m4a"
            uploadService.uploadFile(videoUrl: videoURL, input: input)
            videoURL.stopAccessingSecurityScopedResource()
}

func uploadFileWithMultipart(endPoint: UploadEndpoint) {
        var urlRequest: URLRequest
        urlRequest = endPoint.urlRequest
        uploadTask = URLSession.shared.uploadTask(withStreamedRequest: urlRequest)
        uploadTask?.delegate = self
        uploadTask?.resume()
    }

Please clarify what you mean by “gets stuck”.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Getting error:

Task <3E10DD4F-68BF-4381-99BF-C40E121D03B0>.<10> finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2102, NSUnderlyingError=0x2802b48a0 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <3E10DD4F-68BF-4381-99BF-C40E121D03B0>.<10>, _NSURLErrorRelatedURLSessionTaskErrorKey=("LocalDataTask <3E10DD4F-68BF-4381-99BF-C40E121D03B0>.<10>" ), NSLocalizedDescription=The request timed out., NSErrorFailingURLStringKey=https://avoma-prod-user-uploads.s3.amazonaws.com/, NSErrorFailingURLKey=https://avoma-prod-user-uploads.s3.amazonaws.com/, _kCFStreamErrorDomainKey=4}

Although tried increasing timeout , but still the same error

The same thing works better for uploading a file from mobile Files but the audio recorded just now, fails.

Unable to upload recording of more than 15 mins to AWS server
 
 
Q