# Record and playback with effects in real time

**URL:** <https://qa.fmod.com/t/record-and-playback-with-effects-in-real-time/12361>\
**Category:** FMOD Engine\
**Created:** [March 7, 2016, 10:01pm UTC](https://qa.fmod.com/t/record-and-playback-with-effects-in-real-time/12361 "2016-03-07T22:01:45Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olga123](https://avatars.discourse-cdn.com/v4/letter/o/7bcc69/32.png) [@Olga123](https://qa.fmod.com/u/Olga123)\
**Post date:** [March 7, 2016, 10:01pm UTC](https://qa.fmod.com/t/record-and-playback-with-effects-in-real-time/12361/1 "2016-03-07T22:01:45Z")

</div>

Hi

Could anyone help me? I want to do an app for recording audio signal from microphone, do some effects on this signal (for example low pass effect) but through FIR/IIR filter with transfer function (not through fmod methods), and then playback it IN REAL TIME.  
I think i know how to get array of input samples, transfer this samples (do some effects) but i dont know how this changed array of output samples get to the output and play it.  
Is it possible to do it ?

Thanks for reaction.

P.S. I apologize for my english 🙂 but i hope you will understand

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [March 7, 2016, 10:37pm UTC](https://qa.fmod.com/t/record-and-playback-with-effects-in-real-time/12361/2 "2016-03-07T22:37:22Z")

</div>

To achieve this goal I recommend taking a look at the “recording” example we ship, it shows recording from the microphone and playback in realtime.

Next you should look at the “dsp\_custom” example, it shows how to set up a custom DSP where you can put your processing logic.

---

<div class="post-metadata">

**Author:** ![Olga123](https://avatars.discourse-cdn.com/v4/letter/o/7bcc69/32.png) [@Olga123](https://qa.fmod.com/u/Olga123)\
**Post date:** [March 8, 2016, 7:43pm UTC](https://qa.fmod.com/t/record-and-playback-with-effects-in-real-time/12361/3 "2016-03-08T19:43:57Z")

</div>

Thank you. 🙂  
And in that “dsp\_custom” example there is the callback function for dsp effect…so if I wanted to make multiple effects I use for every effect one callback function?

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [March 8, 2016, 8:46pm UTC](https://qa.fmod.com/t/record-and-playback-with-effects-in-real-time/12361/4 "2016-03-08T20:46:27Z")

</div>

> [@](#):
>
> Thank you. 🙂  
> And in that “dsp\_custom” example there is the callback function for dsp effect…so if I wanted to make multiple effects I use for every effect one callback function?

Each different type of DSP would have its own FMOD\_DSP\_DESCRIPTION with its own set of callbacks. If you want multiple instances of the same type of DSP you simply call createDSP multiple times. You can also chain multiple DSPs together by calling addDSP twice, once for each DSP.

---

<div class="post-metadata">

**Author:** ![xubo](https://avatars.discourse-cdn.com/v4/letter/x/77aa72/32.png) [@xubo](https://qa.fmod.com/u/xubo)\
**Post date:** [September 14, 2018, 7:50am UTC](https://qa.fmod.com/t/record-and-playback-with-effects-in-real-time/12361/5 "2018-09-14T07:50:34Z")

</div>

Add dsp need playback? Does it make a big delay？

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [September 17, 2018, 2:29am UTC](https://qa.fmod.com/t/record-and-playback-with-effects-in-real-time/12361/6 "2018-09-17T02:29:34Z")

</div>

Please create a new question, explain what you are trying to do and provide an example of what isn’t working.

---

<div class="post-metadata">

**Author:** ![Olga123](https://avatars.discourse-cdn.com/v4/letter/o/7bcc69/32.png) [@Olga123](https://qa.fmod.com/u/Olga123)\
**Post date:** [April 2, 2016, 2:01pm UTC](https://qa.fmod.com/t/record-and-playback-with-effects-in-real-time/12361/7 "2016-04-02T14:01:11Z")

</div>

Hello,

I have one more problem.  
I want to do application for streaming audio in real time ( recording sound and playback it in the same time with low latency) and also save it to file. That is working.  
When I add some DSP effect to recording, it is audible but it doesnt show in saved file. I used method from “recordtodisk” example.  
Also I was trying to use FMOD\_OUTPUTTYPE\_WAVWRITER, then my recording was not audible, but it was showed in saved file.  
How can I do both at once? ( be audible and also showed in saved file).

And I want to plot two spectrum, one of input sound and second of output changed sound. The first one wouldnt be a problem, but the second one is. What if I use more then one dsp effects and I need plot the finaly spectrum, how can I do that? I know “dsp\_custom” example , but it is not rigth way for me. Or maybe it is but i dont know how to do it.

Thank you for your response. 🙂

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [April 6, 2016, 1:25am UTC](https://qa.fmod.com/t/record-and-playback-with-effects-in-real-time/12361/8 "2016-04-06T01:25:16Z")

</div>

> [@](#):
>
> Hello,
> 
> I have one more problem.  
> I want to do application for streaming audio in real time ( recording sound and playback it in the same time with low latency) and also save it to file. That is working.  
> When I add some DSP effect to recording, it is audible but it doesnt show in saved file. I used method from “recordtodisk” example.  
> Also I was trying to use FMOD\_OUTPUTTYPE\_WAVWRITER, then my recording was not audible, but it was showed in saved file.  
> How can I do both at once? ( be audible and also showed in saved file).
> 
> And I want to plot two spectrum, one of input sound and second of output changed sound. The first one wouldnt be a problem, but the second one is. What if I use more then one dsp effects and I need plot the finaly spectrum, how can I do that? I know “dsp\_custom” example , but it is not rigth way for me. Or maybe it is but i dont know how to do it.
> 
> Thank you for your response. 🙂

The recordtodisk example will output only the audio recorded and using wavwriter will not allow you to use a microphone. The way to capture the playing audio including effects is to create another custom DSP and attach it to the master channel group:

System::getMasterChannelGroup, then  
ChannelGroup::addDSP.

By attaching it to the master you will receive the same audio that is being sent to the speakers.

---

<div class="post-metadata">

**Author:** ![samychen](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@samychen](https://qa.fmod.com/u/samychen)\
**Post date:** [March 29, 2018, 5:32am UTC](https://qa.fmod.com/t/record-and-playback-with-effects-in-real-time/12361/9 "2018-03-29T05:32:13Z")

</div>

Hi Mathew Block  
I have a big problem, I change the sound and play well,but i read from memory and save it to the disk,the sound does not changed anymore!  
why?

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [April 3, 2018, 6:08am UTC](https://qa.fmod.com/t/record-and-playback-with-effects-in-real-time/12361/10 "2018-04-03T06:08:31Z")

</div>

Please create a new question, explain what you are trying to do and provide an example of what isn’t working.

---

<div class="post-metadata">

**Author:** ![qusax](https://avatars.discourse-cdn.com/v4/letter/q/edb3f5/32.png) [@qusax](https://qa.fmod.com/u/qusax)\
**Post date:** [January 7, 2019, 10:40pm UTC](https://qa.fmod.com/t/record-and-playback-with-effects-in-real-time/12361/11 "2019-01-07T22:40:15Z")

</div>

Were can i find the recording example?  
Checked all youtube videos but cannot find it

Thanks!

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [January 11, 2019, 4:02am UTC](https://qa.fmod.com/t/record-and-playback-with-effects-in-real-time/12361/12 "2019-01-11T04:02:29Z")

</div>

You can find our record example projects included in the LowLevel API download.  
[https://www.fmod.com/download](https://www.fmod.com/download)

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [January 11, 2019, 4:02am UTC](https://qa.fmod.com/t/record-and-playback-with-effects-in-real-time/12361/13 "2019-01-11T04:02:43Z")

</div>


