After recording with AVAudioRecorder the resulting sound file has to be sent to a webservice. The file data has to be URL encoded and copied into the body of the POST request. The recording format is kAudioFormatAppleLossless. As a first step, prior to URL encoding, I tried to copy the .caf file into a NSString, using
NSStringEncoding encoding;
NSString * filestring = [NSString
stringWithContentsOfURL:self.audioRecorder.url
usedEncoding:&encoding
error:&error];
我有以下错误:
Error territorial=NSCocoaErrorDomain Code=264 “这项行动可能已完成。 (Cocoa差错264)”
The encoding returned was 0x5bab9f0, which is not among the list of values defined for NSStringEncoding. What encoding does AVAudioRecorder use when writing to the file? What is the best way of converting a binary file to a URL encoded string?