marinofaggiana 6 年之前
父节点
当前提交
9a5ed21db2
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift

+ 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
         }