Amit Mandloi Amit Mandloi - 1 year ago 143
iOS Question

How to convert .caf file to .wav or .wma file using this code POVoiceHUD on GitHub

I am working on audio recording. I am able to record my audio in .caf (Core audio format)and later I need to convert it to .wav or .wma in order to upload the file on FTP Server. How can I convert the file to .wav or .wma format in iOS? Using POVoiceHUD code from GitHub. Can any one help me to solve my problem.

Answer Source

First you have to change save file extension .caf to .wav in below line given

 [self.voiceHud startForFilePath:[NSString stringWithFormat:@"%@/Documents/MySound.wav", NSHomeDirectory()]];    

Then goto the method (startForFilePath:) change the settings for the voice quality.

      NSDictionary *recordSettings = [NSDictionary 
                                [NSNumber numberWithInt:AVAudioQualityMin],
                                 [NSNumber numberWithInt:16], 
                                 [NSNumber numberWithInt: 2], 
                                 [NSNumber numberWithFloat:8000.0], AVSampleRateKey,
                                 [NSNumber numberWithInt:8], AVLinearPCMBitDepthKey,
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download