【问题标题】:Is there a demo for add effects and export to wav files?是否有添加效果和导出到 wav 文件的演示?
【发布时间】: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);
}

【问题讨论】:

    标签: audio effects fmod


    【解决方案1】:

    您的问题非常广泛,我鼓励您重新关注您遇到问题的领域。

    不过,要普遍回答您的问题,您将需要几个 API 来实现您的目标,其中一些在您的代码中。

    让 FMOD 系统准备好输出 .wav:

    • System_Create
    • System::setOutput
    • 系统::初始化

    创建和准备所需的效果:

    • System::createDSPByType
    • 系统::addDSP

    创建和播放所需的声音:

    • System::createSound
    • System::playSound

    检查声音何时结束:

    • 系统::更新
    • Channel::isPlaying

    关闭并完成.wav

    • 声音::释放
    • 系统::发布

    这是使用 FMOD 实现目标的一种方法的基本概述。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多