|
@@ -458,7 +458,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
newSubtitle.taskID = (header?["task_id"] as? String) ?? ""
|
|
newSubtitle.taskID = (header?["task_id"] as? String) ?? ""
|
|
|
|
|
|
// 这里加300ms 是因为返回结果为了切到字,时长提前一些时间,具体时间官方没说和原音频有关系。这里我们先延后300ms 单位:毫秒。
|
|
// 这里加300ms 是因为返回结果为了切到字,时长提前一些时间,具体时间官方没说和原音频有关系。这里我们先延后300ms 单位:毫秒。
|
|
-
|
|
|
|
|
|
+
|
|
newSubtitle.timelineIn = (self?.recorderManager?.voiceModel?.startTime ?? 0.0) + Float64((((payload?["begin_time"]) as? Int) ?? 0) + 300) / 1000.0
|
|
newSubtitle.timelineIn = (self?.recorderManager?.voiceModel?.startTime ?? 0.0) + Float64((((payload?["begin_time"]) as? Int) ?? 0) + 300) / 1000.0
|
|
|
|
|
|
newSubtitle.timelineOut = (self?.recorderManager?.voiceModel?.startTime ?? 0.0) + Float64(((payload?["time"]) as? Int) ?? 0) / 1000.0
|
|
newSubtitle.timelineOut = (self?.recorderManager?.voiceModel?.startTime ?? 0.0) + Float64(((payload?["time"]) as? Int) ?? 0) / 1000.0
|
|
@@ -555,7 +555,6 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
self?.resetCurrentProgress()
|
|
self?.resetCurrentProgress()
|
|
self?.deleteRecordBtn.isHidden = true
|
|
self?.deleteRecordBtn.isHidden = true
|
|
self?.recordBtn.isHidden = (self?.itemModels[self?.currItemModelIndex ?? 0].mediaType == .IMAGE && (self?.isEndPlay ?? false)) ? false : (self?.isEndPlay ?? false)
|
|
self?.recordBtn.isHidden = (self?.itemModels[self?.currItemModelIndex ?? 0].mediaType == .IMAGE && (self?.isEndPlay ?? false)) ? false : (self?.isEndPlay ?? false)
|
|
- self?.recorderManager?.voiceModel = nil
|
|
|
|
}
|
|
}
|
|
sself.currentPlayRecordIndex = -3 // 刚录音完,不需要播放录音
|
|
sself.currentPlayRecordIndex = -3 // 刚录音完,不需要播放录音
|
|
BFLog(3, message: "重置播放index-\(#function) = \(sself.currentPlayRecordIndex)")
|
|
BFLog(3, message: "重置播放index-\(#function) = \(sself.currentPlayRecordIndex)")
|
|
@@ -808,9 +807,6 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
if !checkStatus(show: false) {
|
|
if !checkStatus(show: false) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
-
|
|
|
|
- let point = recognizer.location(in: bottomeView)
|
|
|
|
-
|
|
|
|
switch recognizer.state {
|
|
switch recognizer.state {
|
|
case .began:
|
|
case .began:
|
|
touchStart = recognizer.location(in: bottomeView)
|
|
touchStart = recognizer.location(in: bottomeView)
|
|
@@ -1172,6 +1168,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
searchStopAtRecordRange(needAdsorb: true)
|
|
searchStopAtRecordRange(needAdsorb: true)
|
|
changeWithDrawBtnLayout(0)
|
|
changeWithDrawBtnLayout(0)
|
|
isEndPlay = (progress == 1)
|
|
isEndPlay = (progress == 1)
|
|
|
|
+ recorderManager?.voiceModel = nil
|
|
}
|
|
}
|
|
|
|
|
|
// 是否吸附在录音首尾处
|
|
// 是否吸附在录音首尾处
|
|
@@ -1431,6 +1428,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
|
|
|
func play() {
|
|
func play() {
|
|
BFLog(1, message: "开始播放 \(currentAssetProgress.seconds)")
|
|
BFLog(1, message: "开始播放 \(currentAssetProgress.seconds)")
|
|
|
|
+ recorderManager?.voiceModel = nil
|
|
|
|
|
|
isNormalPlaying = true
|
|
isNormalPlaying = true
|
|
if isEndPlay {
|
|
if isEndPlay {
|
|
@@ -1703,11 +1701,9 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
// 注:视频无法以录制进度驱动,因当录音开始录音时播放器还未播放,导致进度不一致
|
|
// 注:视频无法以录制进度驱动,因当录音开始录音时播放器还未播放,导致进度不一致
|
|
// 注:在录制停止时,视频播放器进度依然在走,误差在80毫秒左右
|
|
// 注:在录制停止时,视频播放器进度依然在走,误差在80毫秒左右
|
|
if isRecording, itemModels[currItemModelIndex].mediaType == .IMAGE {
|
|
if isRecording, itemModels[currItemModelIndex].mediaType == .IMAGE {
|
|
- let ratioX = 0.08
|
|
|
|
let startTime = recorderManager?.voiceModel?.startTime ?? 0
|
|
let startTime = recorderManager?.voiceModel?.startTime ?? 0
|
|
-
|
|
|
|
// 使用播放器的进度来画线,因为进度是跟着播放器来了
|
|
// 使用播放器的进度来画线,因为进度是跟着播放器来了
|
|
- indirectionView?.setProgress(start: startTime, progress: max(0, progress - ratioX))
|
|
|
|
|
|
+ indirectionView?.setProgress(start: startTime, progress: progress)
|
|
}
|
|
}
|
|
if itemModels[currItemModelIndex].mediaType == .IMAGE {
|
|
if itemModels[currItemModelIndex].mediaType == .IMAGE {
|
|
imageRecordProgress(isRecord: true, progress: progress)
|
|
imageRecordProgress(isRecord: true, progress: progress)
|