Tag: anetworking

发送AVAudioRecorder到服务器iOS

我试图在过去的几天上传一个本地保存的soundelogging到一个服务器(它用php文件把它保存到服务器)。 问题是我找不到一个方法来做到这一点。 在录制声音(AVAudioRecorder)时,它保存在“NSTemporaryDirectory()”中: NSURL *temporaryRecFile = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"VoiceFile"]]]; 现在,我查到的答案是使用ASIHTTPRequest 。 但问题是,它不支持在iOS 6。 还有一些其他的库,但不pipe什么和我怎么尝试都没有什么作用。 如果有人能帮助我,我会喜欢它… 这是我的代码: ViewController.h #import <UIKit/UIKit.h> #import <AVFoundation/AVFoundation.h> #import <CoreAudio/CoreAudioTypes.h> @interface ViewController : UIViewController <AVAudioRecorderDelegate,AVAudioPlayerDelegate> { UIButton *recordButton; UIButton *playButton; UIButton *uploadFile; UILabel *recStateLabel; BOOL isNotRecording; NSURL *temporaryRecFile; AVAudioRecorder *recorder; AVAudioPlayer *player; } @property (nonatomic,retain) IBOutlet UIButton *uploadFile; @property (nonatomic,retain) IBOutlet […]