|
@@ -464,9 +464,9 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
} else {
|
|
|
if let voice = self?.itemModels[self?.currItemModelIndex ?? 0].voiceStickers.first(where: { m in
|
|
|
m.wavFilePath == audioFilePath
|
|
|
- }){
|
|
|
- newSubtitle.timelineIn = (voice.startCMTime.seconds ) + Float64((((payload?["begin_time"]) as? Int) ?? 0) + 300) / 1000.0
|
|
|
- newSubtitle.timelineOut = (voice.startCMTime.seconds ) + Float64(((payload?["time"]) as? Int) ?? 0) / 1000.0
|
|
|
+ }) {
|
|
|
+ newSubtitle.timelineIn = voice.startCMTime.seconds + Float64((((payload?["begin_time"]) as? Int) ?? 0) + 300) / 1000.0
|
|
|
+ newSubtitle.timelineOut = voice.startCMTime.seconds + Float64(((payload?["time"]) as? Int) ?? 0) / 1000.0
|
|
|
}
|
|
|
}
|
|
|
var showText = ((payload?["result"]) as? String) ?? ""
|
|
@@ -669,7 +669,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
|
|
|
@objc func editSubtitle() {
|
|
|
BFLog(message: "编辑字幕 index:\(showSubtitleIndex)")
|
|
|
- if !isNormalPlaying && subtitleLabel.text?.count != 0{
|
|
|
+ if !isNormalPlaying, subtitleLabel.text?.count != 0 {
|
|
|
subtitleEditView.isHidden = false
|
|
|
subtitleEditView.textView.becomeFirstResponder()
|
|
|
subtitleEditView.setNewText(text: subtitleLabel.text ?? "", index: showSubtitleIndex)
|
|
@@ -949,7 +949,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
collectionView.isScrollEnabled = false
|
|
|
// 开始录制时清除屏幕上的字幕
|
|
|
subtitleLabel.text = ""
|
|
|
-
|
|
|
+
|
|
|
pause()
|
|
|
if recorderManager == nil {
|
|
|
BFLog(message: "录音机初始化错误!!!")
|
|
@@ -1625,7 +1625,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
self?.progressThumV.progress = time.seconds
|
|
|
}
|
|
|
// 更新字幕
|
|
|
- if !(self?.isRecording ?? false){
|
|
|
+ if !(self?.isRecording ?? false) {
|
|
|
self?.updateSubtitle(time: time)
|
|
|
}
|
|
|
}
|
|
@@ -1633,7 +1633,6 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
}
|
|
|
|
|
|
if isRecording {
|
|
|
- let ratioX = 0.08
|
|
|
let startTime = recorderManager?.voiceModel?.startCMTime.seconds ?? 0
|
|
|
let progress = currentAssetProgress.seconds - startTime // - ratioX
|
|
|
// 使用播放器的进度来画线,因为进度是跟着播放器来了
|