Search code examples
iphoneobjective-caudioeffectsfmod

FMOD_OUTPUTTYPE_WAVWRITER FMOD error! (23) File not found


I am using FMOD to add effect on audio files.

here is my code

    char cDest[200] = {0}; 
    NSString *fileName=[NSString stringWithFormat:@"%@/recordName.wav", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]];
    NSLog(@"%@",fileName);

    [fileName getCString:cDest maxLength:200 encoding:NSASCIIStringEncoding]; 
    result = system->setOutput(FMOD_OUTPUTTYPE_WAVWRITER); ERRCHECK(result);


    result = system->init(32, FMOD_INIT_NORMAL | FMOD_INIT_ENABLE_PROFILE, NULL);
    ERRCHECK(result);

I am getting this error FMOD error! (23) File not found. when add FMOD_OUTPUTTYPE_WAVWRITER

Please help me


Solution

  • Friends I fixed this issue, myself

    Here is the code. hope it will help some one

    [strSavedFile getCString:cDest maxLength:200 encoding:NSASCIIStringEncoding]; 
    result = system->setOutput(FMOD_OUTPUTTYPE_WAVWRITER_NRT); ERRCHECK(result);
    
    result = system->init(32, FMOD_INIT_NORMAL, cDest);
    

    Just change

    result = system->init(32, FMOD_INIT_NORMAL | FMOD_INIT_ENABLE_PROFILE, NULL);
    

    with

    result = system->init(32, FMOD_INIT_NORMAL, cDest);
    

    And enjoy