How to programmatically create an empty .m4a file of a certain length under iOS using CoreAudio on device?

半世苍凉 提交于 2019-12-02 13:16:39

问题


I need to create a dummy .m4a file of a certain length programatically under iOS...


回答1:


try this

NSError *error = nil;
path = [path stringByAppendingPathComponent:@"tempfile"];
NSURL *URL = [NSURL fileURLWithPath:path];
[[NSFileManager defaultManager]createFileAtPath:path contents:nil attributes:nil]
NSFileHandle *writeFile = [NSFileHandle fileHandleForWritingToURL:URL error:&error];
[writeFile truncateFileAtOffset:4000000000*sizeof(Byte)];


来源:https://stackoverflow.com/questions/7011070/how-to-programmatically-create-an-empty-m4a-file-of-a-certain-length-under-ios

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