[ad_1]
I am facing an issue using the library to convert from m4a to wav. I am using FormatConverter class, implementation of the function is correct, but the output is still m4a and it does not convert to wav.
This is the conversion code I am using, similar to the sample provided in the library.
var options = FormatConverter.Options()
options.format = "wav"
options.sampleRate = 48000
options.bitDepth = 24
let converter = FormatConverter(inputURL: selectedFileURL, outputURL: sandboxFileURL, options: options)
converter.start { error in
if error == nil {
print("Conversion successed.")
}
The file changes actually, it goes from “selectedFileURL” to “sandboxFileURL” with an increased size, the sample I am using is 76 KB, after the conversion it goes to 1.3 MB but with the same format m4a.
I am originally thinking of taking a long voice recorded using Voice Memos app, then upload it to the application and do the conversion from m4a to wav, but it stays m4a.
I uploaded two screenshots before and after the conversion from files application.
Before the conversion
After the conversion
Is there something wrong I am missing?
Thank you.
[ad_2]