2
FMOD를 사용하고 효과가있는 오디오가 있지만 파일에 효과가있는 오디오를 저장하는 방법을 모르겠습니다.FMOD를 사용하여 파일에 출력 저장
#include "fmod.hpp"
#include "common.h"
#include <android/log.h>
int FMOD_Main(int position, const char *fileName) {
FMOD::System *system = 0;
FMOD::Sound *sound = 0;
FMOD::Channel *channel = 0;
FMOD::ChannelGroup *mastergroup = 0;
FMOD::DSP *effect1 = 0;
FMOD_RESULT result;
int pos = position;
void *extradriverdata = 0;
FMOD::Sound *sound2 = 0;
Common_Init(&extradriverdata);
__android_log_print(ANDROID_LOG_DEBUG, "LOG",
"Need to print : %d ", pos);
__android_log_print(ANDROID_LOG_DEBUG, "LOG",
"Need to print fileName : %s ", fileName);
char cDest[200] = {0};
result = FMOD::System_Create(&system);
system->setOutput(FMOD_OUTPUTTYPE_WAVWRITER);
result = system->init(2, FMOD_INIT_NORMAL, cDest);
result = system->getMasterChannelGroup(&mastergroup);
result = system->setStreamBufferSize(64 * 1024, FMOD_TIMEUNIT_RAWBYTES);
result = system->createSound(Common_MediaPath(fileName), FMOD_DEFAULT, 0,
&sound);
result = system->playSound(sound, 0, false, &channel);
if (pos == 0) {
__android_log_print(ANDROID_LOG_DEBUG, "LOG", "Original");
} else if (pos == 1) {
result = system->createDSPByType(FMOD_DSP_TYPE_ECHO, &effect1);
__android_log_print(ANDROID_LOG_DEBUG, "LOG", "ecco");
} else {
result = system->createDSPByType(FMOD_DSP_TYPE_SFXREVERB, &effect1);
__android_log_print(ANDROID_LOG_DEBUG, "LOG", "Original");
}
result = mastergroup->addDSP(0, effect1);
result = effect1->setBypass(true);
bool bypass;
result = effect1->getBypass(&bypass);
bypass = !bypass;
result = effect1->setBypass(bypass);
bool isPlaying = true;
do {
result = system->update();
result = channel->isPlaying(&isPlaying);
if (!isPlaying) {
break;
}
{
bool paused = 0;
if (channel) {
result = channel->getPaused(&paused);
if ((result != FMOD_OK) && (result != FMOD_ERR_INVALID_HANDLE)
&& (result != FMOD_ERR_CHANNEL_STOLEN)) {
__android_log_print(ANDROID_LOG_ERROR, "LOG",
"Error al reproducir ");
break;
}
}
}
Common_Sleep(10);
} while (1);
result = sound->release();
result = system->close();
result = system->release();
__android_log_print(ANDROID_LOG_DEBUG, "LOG", "end Playing");
Common_Close();
return 0;
}
나는 시스템 ->의 setOutput (FMOD_OUTPUTTYPE_WAVWRITER)를 사용하지만, 내가 출력 파일의 이름을 넣어 어디 있는지 모른다.