|
@@ -43,6 +43,9 @@ public class BFRecordExport {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //选择的背景音乐信息
|
|
|
+ public var bgmModel:PQVoiceModel?
|
|
|
+
|
|
|
var count = 0
|
|
|
|
|
|
var stickerRanges = [CMTimeRange]()
|
|
@@ -563,7 +566,16 @@ extension BFRecordExport {
|
|
|
tempParameters += mergeRecordVoiceOnly(voices: voices, composition)
|
|
|
}
|
|
|
}
|
|
|
+ //add by ak 处理背景音乐 如果选择了背景音乐添加背景音乐音轨
|
|
|
+ BFLog(message: "合成视频总时长:\(composition.duration.seconds)")
|
|
|
+ if bgmModel != nil, bgmModel?.wavFilePath != nil {
|
|
|
+ let bgmParameters = PQPlayerViewModel.dealWithBGMTrack(bgmData: bgmModel!, totalDuration: composition.duration.seconds, composition: composition)
|
|
|
+ if bgmParameters.count > 0 {
|
|
|
+ tempParameters += bgmParameters
|
|
|
+ }
|
|
|
+ }
|
|
|
audioMix.inputParameters = tempParameters
|
|
|
+
|
|
|
return (audioMix, composition)
|
|
|
}
|
|
|
|
|
@@ -593,6 +605,7 @@ extension BFRecordExport {
|
|
|
continue
|
|
|
}
|
|
|
tempParameters += PQPlayerViewModel.dealWithMaterialTrack(stickerModel: model, composition: composition)
|
|
|
+ totalDur += model.aptDuration
|
|
|
}
|
|
|
|
|
|
return tempParameters
|