0
我在我的應用中使用AVAsset並遇到了下一個問題。 當我寫這樣的東西:來自應用沙盒的AVAsset
AVAsset *audioAsset = [AVAsset assetWithURL:[NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/Hello.mp3", [[NSBundle mainBundle] resourcePath]]]];
它的工作很好。但是,當我試圖從應用程序的沙箱一樣,從我的tmp目錄新鮮的記錄文件:
AVAsset *audioAsset2 = [AVAsset assetWithURL:[NSURL URLWithString:[NSTemporaryDirectory() stringByAppendingPathComponent:[@"speechRecord" stringByAppendingPathExtension:@"m4a"]]]];
它不工作過。即使我嘗試將視頻文件添加到沙箱中的資產 - 結果也是一樣的。 我甚至嘗試過使用AVURLAsset
,但資產總是空着。我需要它將兩個音頻文件混合在一起,然後將它與錄製的視頻合併。如果我可以在沒有AVAsset的情況下做到這一點,並且有另一種方法,如果您告訴我,我會很感激。或者可能有另外一個功能呢?