如何创建audiofile.aif
并使用nsdata附加音频?
NSData * audioData = [NSData dataWithBytes:inBuffer->mAudioData length:inBuffer->mAudioDataByteSize * NUM_BUFFERS];
答案 0 :(得分:0)
转换NSData
myData = [NSData dataWithContentsOfURL:myUrl]; //"audiofile.aif" url
使用NSData
writeToFile
方法保存文件。
试试这个
[myData writeToFile:[NSHomeDirectory() stringByAppendingPathComponent:@"Documents/audio.aif"] atomically:YES];