I have Configured AVAudioRecorder
as below to record Audio in Flac Format
Recorder Configuration
let settings: [String: Any] = [
AVFormatIDKey: Int(kAudioFormatFLAC),
AVSampleRateKey: 16000,
AVNumberOfChannelsKey: 1,
AVLinearPCMBitDepthKey: 16,
AVEncoderAudioQualityKey: AVAudioQuality.high.rawValue,
AVLinearPCMIsBigEndianKey: false,
AVLinearPCMIsFloatKey: false,
]
Recording Session
recordingSession.setCategory(AVAudioSessionCategoryPlayAndRecord, with: [.allowBluetooth,.defaultToSpeaker])
Files Record Successfully and Played well in Device and also successfully Uploaded to backend Services.
Issue Some audio file do not get converted using Google Speech API
----> Issues From Google Speech API
- File Doesn't contain FLAC header
- soxi FAIL formats: can't open input file `636737069431546112.flac': FLAC ERROR whilst decoding metadata