combine two .caf files

一笑奈何 提交于 2019-12-07 20:38:32

问题


I have used below code to combine two .caf files.

NSMutableData *datas = [NSMutableData alloc];
NSData *data1 = [NSData dataWithContentsOfFile:path1];
NSData *data2 = [NSData dataWithContentsOfFile:path2];
NSLog(@"file1 size  : %d", [data1 length]);
NSLog(@"file2 size : %d", [data2 length]);
[datas appendData:data1];
[datas appendData:data2];
NSLog(@"file3 size  : %d", [datas length]);
[[NSFileManager defaultManager] createFileAtPath:combinedPath contents:datas attributes:nil];

Problem is; I can able to combine two files. But when I try to play the combined file, it is playing only the first file content.

Please help me to resolve it.

Thanks.


回答1:


I got the solution;

I have used Audio Queue Services to do this process.

Click here for documentation.



来源:https://stackoverflow.com/questions/4050192/combine-two-caf-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!