Support mp4 audio file format

This commit is contained in:
yostyle
2022-10-19 16:36:31 +02:00
parent 1cf8eee842
commit 62bd046af8
2 changed files with 8 additions and 2 deletions
@@ -42,7 +42,12 @@ struct VoiceMessageAudioConverter {
static func convertToMPEG4AAC(sourceURL: URL, destinationURL: URL, completion: @escaping (Result<Void, VoiceMessageAudioConverterError>) -> Void) {
DispatchQueue.global(qos: .userInitiated).async {
do {
try OGGConverter.convertOpusOGGToM4aFile(src: sourceURL, dest: destinationURL)
if sourceURL.pathExtension == "mp4" {
try FileManager.default.copyItem(atPath: sourceURL.path, toPath: destinationURL.path)
} else {
try OGGConverter.convertOpusOGGToM4aFile(src: sourceURL, dest: destinationURL)
}
DispatchQueue.main.async {
completion(.success(()))
}