Reputation: 1697
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
Upvotes: 1
Views: 956
Reputation: 1485
i want to add high pass filer (or any other filter) to the audio file and then save it to the document directory. Below is my code.Its not giving me the result. can you please suggest where i am wrong...
FMOD_RESULT result = FMOD_OK;
char buffer[200] = {0};
unsigned int version = 0;
result = FMOD::System_Create(&system);
ERRCHECK(result);
result = system->getVersion(&version);
ERRCHECK(result);
if (version < FMOD_VERSION)
{
fprintf(stderr, "You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION);
exit(-1);
}
[[NSString stringWithFormat:@"%@/song1.wav", [[NSBundle mainBundle] resourcePath]] getCString:buffer maxLength:200 encoding:NSASCIIStringEncoding];
char cDest[200] = {0};
NSString *fileName=[NSString stringWithFormat:@"%@/recordName.wav", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]];
[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, cDest);
ERRCHECK(result);
result = system->createSound(buffer, FMOD_SOFTWARE, NULL, &sound);
ERRCHECK(result);
result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel);
ERRCHECK(result);
result = system->createDSPByType(FMOD_DSP_TYPE_HIGHPASS, &dsphighpass);
ERRCHECK(result);
result = system->addDSP(dsphighpass, NULL);
ERRCHECK(result);
Upvotes: 2
Reputation: 1697
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
Upvotes: 1