【发布时间】:2011-08-05 12:26:10
【问题描述】:
我想录制一个 .caf 文件,然后将其作为邮件附件发送并在我的 Mac 上提取。问题是 caf 文件在我的应用程序之外无法播放,只能在我的应用程序中播放。我必须使用什么设置才能在我的 Mac 上播放带有 Quicktime 的 .caf 文件,这是我的设置。我将音频文件保存在 iphone Documents 目录中。
NSDictionary *settings =[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt: kAudioFormatAppleLossless], AVFormatIDKey,
[NSNumber numberWithFloat: 44100.0], AVSampleRateKey,
[NSNumber numberWithInt: 2], AVNumberOfChannelsKey,
[NSNumber numberWithInt:128000], AVEncoderBitRateKey,
[NSNumber numberWithInt: AVAudioQualityMax], AVEncoderAudioQualityKey,
nil];
我正在使用外部平台发送附件,我将其发送到转换为 base 的 Web 服务器
NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
NSString *filePath2 = [documentsDirectory stringByAppendingPathComponent:@"VoiceMail.caf"];
attachment1.FileData = [serv convertFileToB64String:filePath2 fileName:@"VoiceMail.caf"];
attachment1.FileName = @"VoiceMail.caf";
message.Attachments = [[NSMutableArray alloc] initWithObjects:attachment1, nil];
【问题讨论】:
标签: iphone objective-c xcode avaudiorecorder