Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

SameeraB

macrumors newbie
Original poster
Nov 18, 2008
9
0
Hello All,

I have to convert an audio file from one from to another in iPhone. I found that we have afconvert in apple developer's example. I tried to use it in my iPhone App. I created a sample application having the files that afconvert uses in /Developer/Example/CoreAudio/Serives/AudioFileTools. But it gives me exec-bad-access when i execute the ExtAudioFileOpenURL api.

I have my input file names "test.mp3" in app's document folder.

Following is the code snippet..

NSArray * arr = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask,
YES
);
NSString *str = [arr objectAtIndex:0];
NSString *str1 = [NSString stringWithFormat:mad:"%@/test.mp3", str];
//NSLog(@"%@", str1);

ExtAudioFileRef file = NULL;
CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)str1, kCFURLPOSIXPathStyle, FALSE);
ExtAudioFileOpenURL(url, &file);

//release the allocated resource


I received "EXC_BAD_ACCESS" in ExtAudioFileOpenURL... :(

Can anybody please help me.. Please..
Thanks in an advance.

sameera
 

SameeraB

macrumors newbie
Original poster
Nov 18, 2008
9
0
hi,

I have checked it.. it is the proper "url".. :(
Anything else I need to look into.. I'm sure i must be missing something..


thanks for the help in an advance
 

SameeraB

macrumors newbie
Original poster
Nov 18, 2008
9
0
I have ensured validity of url by using this url with the AudioFileOpenUrl api.
It works fine.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.