linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] Streaming Audio over call on Android


From: Neo Ware
Subject: [Linphone-developers] Streaming Audio over call on Android
Date: Sat, 2 Jul 2016 18:21:21 +0200

Hi all,

I am trying to stream audio over a call on Android.

I create the call as follows:

public void call() {

try {

String targetSip = "sip:address@hidden";

LinphoneCore core = LinphoneManagerx.getLc();
core.enableAudioMulticast(true);
call = core.invite(targetSip);

notifyStatus("Call in progress to " + targetSip);

LinphonePlayer player = call.getPlayer();
notifyStatus("Player status: " + player.getState().toString());
}
catch (LinphoneCoreException ex) {
notifyError(ex.getMessage());
ex.printStackTrace();
}
}


Then to stream the audio I have tried both:

1) Using the LinphonePlayer as follows:

@Override
public void callState(LinphoneCore linphoneCore, LinphoneCall linphoneCall, LinphoneCall.State state, String s) {
super.callState(linphoneCore, linphoneCall, state, s);

notifyStatus(s);

if (state == LinphoneCall.State.Connected) {
LinphoneCore core = LinphoneManagerx.getLc();

LinphonePlayer player = call.getPlayer();

String file = getExternalFilesDir(null).getAbsolutePath() + "/mpthreetest.mp3";
player.open(file, new LinphonePlayer.Listener() {
@Override
public void endOfFile(LinphonePlayer linphonePlayer) {

}
});


2) Directly use the multicast address:
@Override
public void callState(LinphoneCore linphoneCore, LinphoneCall linphoneCall, LinphoneCall.State state, String s) {
super.callState(linphoneCore, linphoneCall, state, s);

notifyStatus(s);

if (state == LinphoneCall.State.Connected) {
LinphoneCore core = LinphoneManagerx.getLc();
notifyStatus("Multicast address: " + core.getAudioMulticastAddr());

LinphonePlayer player = call.getPlayer();

try {
AudioStream stream = new AudioStream(InetAddress.getByName(core.getAudioMulticastAddr()));
}
catch (SocketException ex) {
ex.printStackTrace();
notifyError(ex.getMessage());
}
catch (UnknownHostException ex) {
ex.printStackTrace();
notifyError(ex.getMessage());
}
}

However in both cases I get:
Incompatible, check codecs or security settings...

I tried turning on the debug logs but it gave me no extra info. How can I achieve this?
Thanks,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]