|
@@ -664,10 +664,10 @@ extension PQStuckPointPublicController {
|
|
var timeRange:CMTimeRange = CMTimeRange.zero
|
|
var timeRange:CMTimeRange = CMTimeRange.zero
|
|
if count > 0 {
|
|
if count > 0 {
|
|
for index in 0 ..< count {
|
|
for index in 0 ..< count {
|
|
-
|
|
|
|
- duration = CMTime(value: CMTimeValue((CMTimeGetSeconds(clipAudioRange.end) - CMTimeGetSeconds(mStartTime)) * Double(playerTimescaleInt)), timescale: playerTimescaleInt)
|
|
|
|
|
|
+ //第0段从0开始到推荐的结束,播放器的开始时间不是从0开始的
|
|
|
|
+ duration = CMTime(value: CMTimeValue((CMTimeGetSeconds(clipAudioRange.end)) * Double(playerTimescaleInt)), timescale: playerTimescaleInt)
|
|
BFLog(message: "每一个文件的 duration \(CMTimeGetSeconds(duration))")
|
|
BFLog(message: "每一个文件的 duration \(CMTimeGetSeconds(duration))")
|
|
- var timeRange = CMTimeRangeMake(start: mStartTime, duration: duration)
|
|
|
|
|
|
+ var timeRange = CMTimeRangeMake(start: .zero, duration: duration)
|
|
|
|
|
|
if(index != 0){
|
|
if(index != 0){
|
|
//(CMTimeGetSeconds(clipAudioRange.end) - CMTimeGetSeconds(mStartTime))为用户选择的第一段时长
|
|
//(CMTimeGetSeconds(clipAudioRange.end) - CMTimeGetSeconds(mStartTime))为用户选择的第一段时长
|
|
@@ -752,9 +752,7 @@ extension PQStuckPointPublicController {
|
|
assetExport?.outputURL = fileUrl
|
|
assetExport?.outputURL = fileUrl
|
|
assetExport?.exportAsynchronously {
|
|
assetExport?.exportAsynchronously {
|
|
if assetExport!.status == .completed {
|
|
if assetExport!.status == .completed {
|
|
- // 85.819125
|
|
|
|
let audioAsset = AVURLAsset(url: fileUrl, options: avAssertOptions)
|
|
let audioAsset = AVURLAsset(url: fileUrl, options: avAssertOptions)
|
|
-
|
|
|
|
BFLog(1,message: "拼接声音文件 完成 \(fileUrl) 时长is \(CMTimeGetSeconds(audioAsset.duration))")
|
|
BFLog(1,message: "拼接声音文件 完成 \(fileUrl) 时长is \(CMTimeGetSeconds(audioAsset.duration))")
|
|
completeHander(fileUrl)
|
|
completeHander(fileUrl)
|
|
|
|
|