Mixed audio in IVR


I don’t know whether or not this topic has already discussed but if YES then am sorry and need someone to point me to the link.

Am developing an IVR service where caller of the IVR number will have to sing and record their song. My issue is that the while singing the caller should hear an audio track in background and when the song is recorded, the audio track and the song become one (1) song thus one (1) file.

Have anyone out there already done such a setting? If yes, could you please let me know where to start and what are the applications involved?

Thank to all of you for your help



I think that this is not a thing that Asterisk would support without major code change.

Another big restriction is that a recording would have a very very low sound quality - 8kHz .wav is rubish when it comes to music reproduction :wink:

So all in all I think that Asterisk is not the best platform for your project …

The quality limitations are likely to be set by the network. I suspect this is a PSTN/mobile phone one. Mobile phones and music do not mix.


Thank you for replying. I got your points.
But please is there a way to just play the background audio while the caller is recording what he wants and when he presses for example # to end the recording, I can just use soxmix to mix the audio and what was saved by the RECORD command?


You have now introduced two complications:

  1. simultaneous recording and playback;

  2. synchronising the recording with the playback.

I don’t think there is a mechanism for doing (1) as it would normally be undesirable, because there would be some of the outgoing sound coming back on the incoming side.

(2) means you have to allow for any skew between starting the playback and starting the recording, and also for the, unknown, round trip delay in the network and the remote party’s phone system. You would probably have to rely on far end echo to get a synchronisation reference. That will require a custom mixing program, not a commodity one.

Which means it’s not possible to run this kind of service using Asterisk?

It’s software, anything is possible. :wink:

Asterisk does not provide an out of the box feature for your application - but that’s one of the things that makes Asterisk interesting; people take it and use it to solve their wacky use-cases. Good luck.