CAF

combine two .caf files

一笑奈何 提交于 2019-12-07 20:38:32
问题 I have used below code to combine two .caf files. NSMutableData *datas = [NSMutableData alloc]; NSData *data1 = [NSData dataWithContentsOfFile:path1]; NSData *data2 = [NSData dataWithContentsOfFile:path2]; NSLog(@"file1 size : %d", [data1 length]); NSLog(@"file2 size : %d", [data2 length]); [datas appendData:data1]; [datas appendData:data2]; NSLog(@"file3 size : %d", [datas length]); [[NSFileManager defaultManager] createFileAtPath:combinedPath contents:datas attributes:nil]; Problem is; I

iOS: Record audio in other format than caf

寵の児 提交于 2019-12-06 09:47:27
I am working on audio recording. I am able to record my audio in caf (Core audio format). Now I want to record sound in .mp3 or .amr . I tried a lot of google but didn't found anything. I am not sure if my steps following work: Write that Audio with .caf extention to document dir Read data from that file write the file again with .mp3 or .amr extention I have 100% doubt that this will not going to work as this will just re save file with some other extension. This won't change audio codec. I thought that for converting any format whether it is audio or video we need to change its codecs and

combine two .caf files

此生再无相见时 提交于 2019-12-06 08:43:21
I have used below code to combine two .caf files. NSMutableData *datas = [NSMutableData alloc]; NSData *data1 = [NSData dataWithContentsOfFile:path1]; NSData *data2 = [NSData dataWithContentsOfFile:path2]; NSLog(@"file1 size : %d", [data1 length]); NSLog(@"file2 size : %d", [data2 length]); [datas appendData:data1]; [datas appendData:data2]; NSLog(@"file3 size : %d", [datas length]); [[NSFileManager defaultManager] createFileAtPath:combinedPath contents:datas attributes:nil]; Problem is; I can able to combine two files. But when I try to play the combined file, it is playing only the first

iPhone - How to convert .caf audio files into .aac?

时光毁灭记忆、已成空白 提交于 2019-12-06 00:18:55
I am working on audio recording. I am able to record my audio in caf (Core audio format).i followed this tutorial Recording Audio on an iPhone with AVAudioRecorder . Now I don't want to record sound in .aac format directly, I need to convert recorded .caf audio file into .aac audio file... any idea how to do this? #import <UIKit/UIKit.h> #import <AVFoundation/AVFoundation.h> @interface recordViewController : UIViewController <AVAudioRecorderDelegate, AVAudioPlayerDelegate> { AVAudioRecorder *audioRecorder; AVAudioPlayer *audioPlayer; UIButton *playButton; UIButton *recordButton; UIButton

convert .caf file to .wav file with progress bar in ios

回眸只為那壹抹淺笑 提交于 2019-12-05 07:06:52
问题 I record audio in .caf format and later need to convert it to .wav in order to upload the file as a dropbox. How can I convert the file to wav format in iOS? i don't want record audio directly .wav format how to Convert .CAF to .WAV file while conversion takes much more time i need to implement conversion progress bar 回答1: Try this -(void) convertToWav { // set up an AVAssetReader to read from the iPod Library NSString *cafFilePath=[[NSBundle mainBundle]pathForResource:@"test" ofType:@"caf"];

How to record using AVAudioRecorder without the .caf container?

只愿长相守 提交于 2019-12-04 12:39:36
问题 I am using a AVAudioRecorder instance to record with the setting for AVFormatIDKey set to kAudioFormatMPEG4AAC . It records the audio in AAC format but a .caf audio container packages the audio file. (I can see the caff header in the recorder file). How do I record so that the caff container is not there but in pure m4a format so that I can use the files across platforms. 回答1: Found the answer. There is a weird way the AVAudioRecorder works. The format in which the AVAudioRecorder will save

How do I use afconvert to convert all the files in a directory from wav to caf?

冷暖自知 提交于 2019-12-03 02:52:18
问题 I have a directory with about 50 wav files that I need to convert to caf, because AudioServicesCreateSystemSoundID() returns an error for some of them (but not all). Here's an example of the command I've used successfully for a single file: afconvert -f caff -d LEI16@44100 -c 1 whistle.wav whistle.caf How do I do this quickly - not one-by-one for each file? 回答1: On Windows, use the %~ni syntax. for %i in (*.wav) do afconvert -f caff -d LEI16@44100 -c 1 %i %~ni.caf 回答2: Similar approach for

How do I use afconvert to convert all the files in a directory from wav to caf?

别说谁变了你拦得住时间么 提交于 2019-12-02 16:24:55
I have a directory with about 50 wav files that I need to convert to caf, because AudioServicesCreateSystemSoundID() returns an error for some of them (but not all). Here's an example of the command I've used successfully for a single file: afconvert -f caff -d LEI16@44100 -c 1 whistle.wav whistle.caf How do I do this quickly - not one-by-one for each file? lavinio On Windows, use the %~ni syntax. for %i in (*.wav) do afconvert -f caff -d LEI16@44100 -c 1 %i %~ni.caf Randall Similar approach for bash: for i in *.wav; do afconvert -f caff -d LEI16@44100 -c 1 $i ${i%.wav}.caf; done Ward found

Combine two .wav files in iPhone using Objective C

我们两清 提交于 2019-11-30 07:46:54
I want to combine two .wav recording files together. Can any one help me figure out how to achieve this.I tried combining the data but the headers are creating problem. Can we do the combining as we do to combine the wave files. This is how i am doing the combine, NSMutableData *datas = [NSMutableData alloc]; NSData *data1 = [NSData dataWithContentsOfFile: [recordedTmpFile1 path]]; NSData *data2 = [NSData dataWithContentsOfFile: [recordedTmpFile2 path]]; NSLog(@"file1 size : %d", [data1 length]); NSLog(@"file2 size : %d", [data2 length]); [datas appendData:data1]; [datas appendData:data2];

playing a .caf file: works fine in simulator but not in iPhone

时光怂恿深爱的人放手 提交于 2019-11-29 18:06:08
I'm building a voice recorder. Recoding and playing works fine on simulator. But on iphone it doesn't work. (I followed the exact steps as mentioned in iPhoneOSProgrammingGuide/AudioandVideoTechnologies ) printf("%s(player)\n",[[self.soundFileURL absoluteString] UTF8String]); AVAudioPlayer *newPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL: self.soundFileURL error: nil]; if([self.soundFileURL isFileURL]){ printf("isFileURL\n"); } self.player = newPlayer; [newPlayer release]; [player prepareToPlay]; [player setDelegate: self]; //recorderLabel.text=@"Playing.."; [player play]; printf(