[NSMutableArray objectAtIndex:]: index 0 beyond bounds for empty array from AVURLAsset

前端 未结 1 1431
清酒与你
清酒与你 2021-01-11 18:33

I tried with following code to merge the audios.

AVMutableComposition* composition = [AVMutableComposition composition];
AVURLAsset* videoAsset = [[AVURLAss         


        
相关标签:
1条回答
  • 2021-01-11 19:11

    I resolved this issue;

    Just I have replaced the following statement

    NSURL *audioURL = [NSURL URLWithString:path];
    AVURLAsset* videoAsset = [[AVURLAsset alloc]initWithURL:audioURL options:nil]

    with following statement

    NSURL *audioURL = [NSURL fileURLWithPath:path]
    AVURLAsset* videoAsset = [[AVURLAsset alloc]initWithURL:audioURL options:nil]

    Thanks.

    0 讨论(0)
提交回复
热议问题