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
Location Access Request in iOS 11
Convert Time String into Date Swift
Close UIdatepicker After Selection When Style Is .Compact
Nsjsonserialization Error. Code=3840 "Invalid Value Around Character 0
Nsdatepicker in Nsstatusbar Nssmenuitem Not Receiving Input
Move Button When Keyboard Appears Swift
Is There Any Difference at All Between Suffix(From:) and Dropfirst(_:)
Cannot Convert Value of Type 'X' to Expected Argument Type 'X'
Which Optimization Level Should I Choose for Release
A Concise Way to Not Execute a Loop Now That C-Style for Loops Are Going to Be Removed from Swift 3
Performseguewithidentifier Not Working If Called from Viewdidload
Cmlogitem Timestamp: Why So Complicated
How to Change The Data Type in Realm Database
Vapor 3 - How to Check for Similar Email Before Saving Object
Swiftui: UIimage (Qrcode) Does Not Load After Calling Function
How to a Convert a Dictionary Slice to a Dictionary in Swift