Ios 使用AVAudioRecorder录制m4a,然后将该声音文件放入.plist文件
首先,我甚至不能得到一个我认为应该在下面工作的.plist。我只是想写一个NSNumber并检索它Ios 使用AVAudioRecorder录制m4a,然后将该声音文件放入.plist文件,ios,plist,avfoundation,avaudioplayer,avaudiorecorder,Ios,Plist,Avfoundation,Avaudioplayer,Avaudiorecorder,首先,我甚至不能得到一个我认为应该在下面工作的.plist。我只是想写一个NSNumber并检索它 self.paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); self.documentsDirectory = [self.paths objectAtIndex:0]; self.path = [self.documentsDirecto
self.paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
self.documentsDirectory = [self.paths objectAtIndex:0];
self.path = [self.documentsDirectory stringByAppendingPathComponent:@"data.plist"];
self.fileManager = [NSFileManager defaultManager];
NSError *error;
if (![self.fileManager fileExistsAtPath:self.path]) {
self.bundle = [[NSBundle mainBundle] pathForResource:@"data" ofType:@"plist"];
[self.fileManager copyItemAtPath:self.bundle toPath:self.documentsDirectory error:&error];
}
self.dataForDict = [[NSDictionary alloc] initWithContentsOfFile:self.documentSlashAudioPath];
int value = 5;
[self.dataForDict setValue:[NSNumber numberWithInt:value] forKey:@"value"];
[self.dataForDict writeToFile:self.path atomically:YES];
self.number = [self.dataForDict objectForKey:@"value"];
NSLog(@"%i", [self.number intValue]);
最后一个NSLog应该给我一个5,但是输出是0
我正在尝试创建一个.plist文件,其中包含音频,用于声音库播放器:
我知道如何用AVAudioRecorder和AVAudioPlayer录制声音并播放,现在我只需要连接点