marinofaggiana 6 éve
szülő
commit
9a5ed21db2

+ 2 - 0
iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift

@@ -31,6 +31,7 @@ class NCCreateFormUploadVoiceNote: XLFormViewController, NCSelectDelegate, AVAud
     private var titleServerUrl = ""
     private var fileName = ""
     private var fileNamePath = ""
+    private var duration: TimeInterval = 0
     
     private var audioPlayer = AVAudioPlayer()
 
@@ -53,6 +54,7 @@ class NCCreateFormUploadVoiceNote: XLFormViewController, NCSelectDelegate, AVAud
             try audioPlayer = AVAudioPlayer(contentsOf: URL(fileURLWithPath: fileNamePath))
             audioPlayer.prepareToPlay()
             audioPlayer.delegate = self
+            duration = audioPlayer.duration
         } catch {
             buttonPlayStop.isEnabled = false
         }