AVAudioRecorder and audio data file offset

I'm trying to get a wav file to outside API from iOS. I've managed to do the file and post it from iPhone but the service doesn't take it (API errors are not helpful either). I've managed to track down the difference between a file I manage to send to the service and the file save with iPhone to audio data file offset parameter. afinfo command gives the working file value 44 and iOS saved audiofile has 4096. Is there any way to change this to 44 also on iOS?


My current settings for AVAudioRecorder:


let recordSettings = [

AVNumberOfChannelsKey: 1,

AVSampleRateKey: 16000.0,

AVFormatIDKey: kAudioFormatLinearPCM,

AVLinearPCMBitDepthKey: 8,

AVLinearPCMIsBigEndianKey: false,

AVLinearPCMIsFloatKey: false,

AVLinearPCMIsNonInterleaved: false

]

Didn't find any way to do this except to cut the data from FLLR tag.

@fobin. I know this post is super old but I am running into the same issue. I am using a different audio format (uLaw) but same thing, iOS file shows audio offset of 4096 and the API accepts it but it doesn't work. If I run the same file through Audacity and re-export to uLaw, the audio offset becomes 58 and it works. Could you explain what you meant by "cut the data from the FLLR tag"?

AVAudioRecorder and audio data file offset
 
 
Q