ExtAudioFileOpenURL gives bad access..???

Discussion in 'iPhone/iPad Programming' started by SameeraB, Dec 21, 2008.

  1. macrumors newbie

    Joined:
    Nov 18, 2008
    #1
    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
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    Make sure 'url' is actually a valid object. It might be null.
     
  3. thread starter macrumors newbie

    Joined:
    Nov 18, 2008
    #3
    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
     
  4. thread starter macrumors newbie

    Joined:
    Nov 18, 2008
    #4
    I have ensured validity of url by using this url with the AudioFileOpenUrl api.
    It works fine.
     
  5. thread starter macrumors newbie

    Joined:
    Nov 18, 2008
    #5
    can anyone please help me? pls..
     

Share This Page