use of org.jivesoftware.smackx.jingle.mediaimpl.jmf.AudioChannel in project Smack by igniterealtime.
the class JingleMediaTest method testAudioChannelOpenClose.
public void testAudioChannelOpenClose() {
for (int i = 0; i < 5; i++) {
try {
AudioChannel audioChannel0 = new AudioChannel(new MediaLocator("javasound://"), InetAddress.getLocalHost().getHostAddress(), InetAddress.getLocalHost().getHostAddress(), 7002, 7020, new AudioFormat(AudioFormat.GSM_RTP), null);
AudioChannel audioChannel1 = new AudioChannel(new MediaLocator("javasound://"), InetAddress.getLocalHost().getHostAddress(), InetAddress.getLocalHost().getHostAddress(), 7020, 7002, new AudioFormat(AudioFormat.GSM_RTP), null);
audioChannel0.start();
audioChannel1.start();
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
LOGGER.log(Level.WARNING, "exception", e);
}
audioChannel0.stop();
audioChannel1.stop();
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
LOGGER.log(Level.WARNING, "exception", e);
}
} catch (Exception e) {
LOGGER.log(Level.WARNING, "exception", e);
}
}
}
use of org.jivesoftware.smackx.jingle.mediaimpl.jmf.AudioChannel in project Smack by igniterealtime.
the class JingleMediaTest method testAudioChannelStartStop.
public void testAudioChannelStartStop() {
try {
AudioChannel audioChannel0 = new AudioChannel(new MediaLocator("javasound://"), InetAddress.getLocalHost().getHostAddress(), InetAddress.getLocalHost().getHostAddress(), 7002, 7020, new AudioFormat(AudioFormat.GSM_RTP), null);
AudioChannel audioChannel1 = new AudioChannel(new MediaLocator("javasound://"), InetAddress.getLocalHost().getHostAddress(), InetAddress.getLocalHost().getHostAddress(), 7020, 7002, new AudioFormat(AudioFormat.GSM_RTP), null);
for (int i = 0; i < 5; i++) {
audioChannel0.start();
audioChannel1.start();
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
LOGGER.log(Level.WARNING, "exception", e);
}
audioChannel0.stop();
audioChannel1.stop();
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
LOGGER.log(Level.WARNING, "exception", e);
}
}
} catch (Exception e) {
LOGGER.log(Level.WARNING, "exception", e);
}
}
Aggregations