gpt4 book ai didi

ios、iTunes文件共享保存音频文件

转载 作者:行者123 更新时间:2023-11-29 04:07:50 25 4
gpt4 key购买 nike

我尝试以aac类型录制语音文件并在 uitable 中显示并且工作良好,但我无法在 itunes 文件共享中显示

我激活了UIFIleSharingEnabled

但我无法在itunes文件共享中查看aac文件,我该怎么办?

文件格式音频格式MPEG4AAC

文件地址:文件://localhost/Users/myuser/...aac

保存部分

NSArray *keys = [NSArray arrayWithObjects:@"voicestr",,@"datestr",@"durstr",nil];

NSDictionary * HistDict =[[NSDictionary alloc] initWithObjects: [NSArray arrayWithObjects:myString,timeString,dateString,currentimeLbl.text,bestsize ,nil] forKeys:keys];

[Hist addObject:HistDict];

加载文件

 BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:myPath];if (fileExists) 
HistValue = [[NSMutableArray alloc] initWithContentsOfFile:myPath];

最佳答案

您可以使用以下方法获取 iOS 的文档目录:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

NSString *basePath = [paths objectAtIndex:0]

添加文件名

NSString *fielWithPath = [basePath stringByAppendingPathComponent:@"fileNaem"];

并且您必须在 info.plist 中启用文件共享

UIFileSharingEnabled = YES

关于ios、iTunes文件共享保存音频文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14914598/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com