Solution Soni
Solution Soni

Reputation: 183

How to play beep audio file during outgoing call and transmit to receiver

We have implemented pjsua2 library for calls. We are facing some issue in playing audio during outgoing calls. We have also implemented call recording functionality which is working fine. I am not sure how to play a wav file during call which can be heard by receiver too.

We have checked pjsua2 document which is not that up to mark.

getPlayer().createPlayer("file:///android_asset/1540Hz14s8000.wav");
audioMedia.startTransmit(getPlayer());
getCap_med().startTransmit(getPlayer());


  public static AudioMediaPlayer getPlayer() {
        if (player == null) {
            player = new AudioMediaPlayer();
        }
        return player;
    }

public static AudioMedia getCap_med() throws Exception {
        if (cap_med == null) {
            cap_med = MyApp.ep.audDevManager().getCaptureDevMedia();
        }
        return cap_med;
    }

Please help me, I have already spend almost a week.

Upvotes: 0

Views: 494

Answers (1)

user8127814
user8127814

Reputation: 316

You are transmitting the call audio to the .wav file (this is only correct when recording), what you should be doing is transmitting the .wav file to the call audio.

Instead of:

audioMedia.startTransmit(getPlayer());
getCap_med().startTransmit(getPlayer());

You need to do this:

getPlayer().startTransmit(audioMedia);
getPlayer().startTransmit(getCap_med());

Upvotes: 1

Related Questions