|
@@ -450,7 +450,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
func updateSubtitle(time: CMTime) {
|
|
|
var findShowSubtitle: PQEditSubTitleModel?
|
|
|
for (index,subtitle) in itemModels[currItemModelIndex].titleStickers.enumerated() {
|
|
|
- if subtitle.timelineIn <= CMTimeGetSeconds(time) * 1_000_000, subtitle.timelineOut >= CMTimeGetSeconds(time) * 1_000_000 {
|
|
|
+ if subtitle.timelineIn <= CMTimeGetSeconds(time) , subtitle.timelineOut >= CMTimeGetSeconds(time) {
|
|
|
findShowSubtitle = subtitle
|
|
|
BFLog(message: "找到要显示的字幕 in \(findShowSubtitle?.timelineIn ?? 0.0) out \(findShowSubtitle?.timelineOut ?? 0.0) text:\(findShowSubtitle?.text ?? "") currTime is \(CMTimeGetSeconds(time))")
|
|
|
showSubtitleIndex = index
|
|
@@ -1189,7 +1189,7 @@ extension BFRecordScreenController: PQSpeechTranscriberUtilDelegate {
|
|
|
newSubtitle.timelineIn = self.itemModels[self.currItemModelIndex].titleStickers.last?.timelineOut ?? 0
|
|
|
// 当前已处理的音频时长,单位:毫秒。
|
|
|
|
|
|
- newSubtitle.timelineOut = Float64(((payload?["time"]) as? Int) ?? 0) * 1_000.0 + (self.recorderManager.voiceModel?.startTime ?? 0.0) * 1_000_000.0
|
|
|
+ newSubtitle.timelineOut = Float64(((payload?["time"]) as? Int) ?? 0) / 1_000.0 + (self.recorderManager.voiceModel?.startTime ?? 0.0)
|
|
|
var showText = ((payload?["result"]) as? String) ?? ""
|
|
|
if(showText.count > 30){
|
|
|
showText = showText.substring(to: 30)
|