I am loading into memory float array of data, I am using fmodOpenMemory …
If I add some DSP effects, will this float array be modified directly by the DSP effect or does it work differently?
I am asking this because I want to be able to add DSP effect to audio and then export this audio as wav file, with the DSP effect taken into account and being exported into the wav file as well.
- blackmamba asked 4 years ago
That really helps thank you very much, I will try this !
I also have another issue, I have some light clipping when turning on/off dsp custom effects is it normal ? For example I did a DSP to divide amplitude by 4 and I do have this issue.
Chained DSPs are actually a bit easier to just use ChannelGroup::addDSP or Channel::addDSP rather than the lower level addInput stuff.
clipping is not normal if you turn off your DSP .. if you did a straight memcpy from inbuffer to outbuffer that is the standard way to do ‘nothing’ and should not affect the signal at all. Are you sure its not to do with your inner read loop?
I made some experiments trying to find out why I do have some clipping when turning ON/OFF one DSP effect. After some tests, I found out that most of the files do not produce any clipping, including the ones provided by FMOD in the demos. However, with some of my wav files I have clipping.
Do you have any idea why? Could I send you the file that you have a look at it please?
I would also ask you a last question if I may. As I need to do some mixing in my application, with a set of instruments, each instrument can have different effects.
From what you said, I will use one channel for each instrument and use channel->addDSP(dsp) to chain the effects on each instrument.
However, I need to have real time playing and also being able to record the sounds. I read somewhere that the idea to use 2 systems for this make sense is it the case? (one real time, one NRT)
If I want the things to go even further and output each separate instrument in a wav file (to allow post prod mixing), could I use 2 systems per instrument?
Is there a "danger" to use too many systems? Is it just memory/CPU intensive or can it lead to Hardware issues?
fmod will not process a static array of sound data for you.
You have to load the sound, then play the sound, and add the DSP effects to the system so that it can process the data in realtime. It will not touch the original sound data.
To write this out is possible, you can either write your own capture dsp and put it further down the dsp chain, or you could use FMOD_OUTPUTTYPE_WAVWRITER which writes all output to a wav file.
If I use FMOD_OUTPUTTYPE_WAVWRITER, it looks like it outputs to a wave file instead of the speakers, but does it render it in the same amount of time of the original music file? I mean if I want to export with FMOD_OUTPUTTYPE_WAVWRITER a 3minutes long song, will it take 3 minuts to export?
If I use DSP callback method (I write the DSP algoritm by myself), then I guess it would be possible to play the effect normally and when I want to export as wav I just process the static array with my algorithm and export with something like sndfile. Does this sound ok to you? Do you know if it is possible to do like this with already implemented FMOD DSP effects (with FMOD lgorithms implementations I mean) not to have to rewrite the DSP effects?
Are chained DSP effects possible with FMOD callbacks methods?
That’s a lot of questions, sorry about that 😉
I can answer at least some of your questions, although the FMOD guys will have more authoritative answers.
OUTPUTTYPE_WAVWRITER does, in fact, output in realtime. If you want to do non-realtime processing, take a look at FMOD_OUTPUTTYPE_WAVWRITER_NRT. You may want to pair this with FMOD_INIT_STREAM_FROM_UPDATE.
You can chain DSPs by calling DSP::addInput(). Take a look at the "FMOD Ex Advanced DSP Engine" topic (under Tutorials) in the documentation.
Hope that helps!
- Adiss answered 4 years ago
Please login first to submit.