开发者

Saving AVAudioRecorder output online

开发者 https://www.devze.com 2023-02-10 19:38 出处:网络
Is it possible to save the audio output of AVAudioRecorder on a webserver instead of saving it on the local iphone filesys开发者_如何学运维tem ?

Is it possible to save the audio output of AVAudioRecorder on a webserver instead of saving it on the local iphone filesys开发者_如何学运维tem ? there is a method with the signature initWithURL:settings:error: but according to the documentation it only allows to save to the filesystem.

br, martin


NSMutableURLRequest *networkRequest = [[NSMutableURLRequest alloc] init];

NSInputStream* fileStream = [NSInputStream inputStreamWithFileAtPath: filePath]; 
[networkRequest setHTTPBodyStream:fileStream];

NSURLConnection* theConnection = [[NSURLConnection alloc] initWithRequest:networkRequest delegate:self];

This is just sample you can create full Request and Stream it to server, filePath will be physical path of file


The Best idea here is to use a library such as ASIHTTPRequest to send the saved file online after you record it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号