【发布时间】:2015-07-17 01:20:06
【问题描述】:
有没有添加效果和导出到wav文件的demo?
我已经搜索过了,但没有找到解决方法。
将效果添加到 input.wav 文件并播放。然后导出一个带有效果的新 wav 文件。请帮帮我。
我的代码是:
result = FMOD::System_Create(&system);
ERRCHECK(result);
result = system->getVersion(&version);
if (FMOD_OK != result) {
printf("FMOD lib version %08x doesn't match header version %08x", version, FMOD_VERSION);
}
// result = system->setOutput(FMOD_OUTPUTTYPE_WAVWRITER);
// ERRCHECK(result);
char cDest[200] = {0};
NSString *fileName=[NSString stringWithFormat:@"%@/addeffects_sound.wav", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]];
[fileName getCString:cDest maxLength:200 encoding:NSASCIIStringEncoding];
result = system->init(32, FMOD_INIT_NORMAL | FMOD_INIT_PROFILE_ENABLE, cDest);
//result = system->init(32, FMOD_INIT_NORMAL, extradriverdata);
ERRCHECK(result);
result = system->getMasterChannelGroup(&mastergroup);
ERRCHECK(result);
[self createAllDSP];
-(void)createSound:(NSString *)filename
{
//printf("really path = %s", getPath(filename));
result = system->createSound(getPath(filename), FMOD_DEFAULT, 0, &sound);
ERRCHECK(result);
[self playSound];
}
-(void) playSound
{
result = system->playSound(sound, 0, false, &channel);
ERRCHECK(result);
//result = channel->setLoopCount(1);
// ERRCHECK(result);
}
【问题讨论】: