Audiokit - Temporary File Size Is Too Big

Audiokit recording file size too big

This might not be the proper way of doing it but I have managed to reduce 1 minute recording down to 975kb size. I just converted the resulting caf file to a wav file using AKConverter like this:

func getAKConverterOptions()-> AKConverter.Options{
var options = AKConverter.Options()
// any options left nil will assume the value of the input file
options.format = "wav"
options.sampleRate = 8000
options.bitRate = 16
options.channels = 1
options.bitDepth = 16
options.eraseFile = true
options.isInterleaved = true
return options
}

And after export, I converted it like this:

let converter = AKConverter(inputURL: self.getFilePath(name: self.baseRecording.replacingOccurrences(of: ".wav", with: ""), extension: "caf"), outputURL: self.getFilePath(name: self.baseRecording.replacingOccurrences(of: ".wav", with: ""), extension: "wav"), options: self.getAKConverterOptions())
converter.start { (error) in
if error == nil {
exported(true)
}
else{
exported(false)
}
}

How can I upload my project to Github when it is over 100 MB?

I suggest excluding Pods directory (by adding it to your .gitignore file) in your git repository. Pods can be recreated with your podfile, so you don't have to store them in your repository.

Other approach, e.g. when you have framework you precompiled yourself and don't want your other team members to need compile it again, is to use git lfs: https://git-lfs.github.com



Related Topics



Leave a reply



Submit