问题描述
我使用FMOD从文件播放一些声音和我添加一些效果。我想preVIEW添加到它的影响,并保存满意的结果到磁盘。
我一直在使用SetOutput和初始化,然后createSound,playSound尝试
但我不能听到声音并保存在磁盘上的文件似乎是错误的!
I am using FMOD to play some sounds from files and I add some effects. I want to preview the effects added to it, and save the satisfied result to disk.I have tried using SetOutput and Init and then createSound, playSoundbut I cannot hear the sound and the file saved in the disk seems wrong!
如果我不使用setOutput和init系统的第4个参数0,我可以听到声音。
If I don't use setOutput and init system with the 4th parameter 0, I can hear the sound.
我追加code:
result = FMOD_System_SetOutput(gSystem,FMOD_OUTPUTTYPE_WAVWRITER);
result = FMOD_System_Init(gSystem, 32,FMOD_INIT_NORMAL,"/sdcard/wav.wav");
result = FMOD_System_CreateSound(gSystem, filename, FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &gSound);
result = FMOD_System_PlaySound(gSystem, FMOD_CHANNEL_FREE, gSound, 0, &gChannel);
希望你能帮帮我!
Hope you can help me!
感谢您
推荐答案
如果您使用setOutput与WavWriter音频会去一个文件,而不是扬声器。如果这是不是你正在寻找也许你应该尝试捕获音频与定制的DSP。
If you use setOutput with WavWriter the audio will go to a file instead of the speakers. If this isn't what you are looking for perhaps you should try capturing the audio with a custom DSP.
其基本思想是你按照dsp_custom例如,使DSP创建一个用户,然后在DSP读取回调将数据写入到磁盘中。还必须进入在DSP到输出缓冲区(直接的memcpy)复制数据,以允许音频通过传递给扬声器。你可以在任何地方放置DSP要捕获音频DSP网络。如果你只在最后的混音感兴趣,只需要使用系统:: addDSP。
The basic idea is you follow the dsp_custom example, make a user created DSP, then in the DSP read callback write the data out to disk. You must also copy the data coming into the DSP into the output buffer (direct memcpy) to allow the audio to pass through to the speakers. You can place the DSP anywhere in the DSP network you want to capture audio. If you are only interested in the final mix, just use System::addDSP.
这篇关于FMOD:读取音频文件,添加效果,然后将结果保存的int文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!