use of com.sun.voip.Recorder in project Openfire by igniterealtime.
the class WhisperGroup method recordConference.
public void recordConference(boolean enabled, String recordingFile, String recordingType) throws IOException {
if (enabled == false) {
synchronized (recordingLock) {
if (audioRecorder != null) {
audioRecorder.done();
audioRecorder = null;
}
this.recordingFile = null;
}
return;
}
if (audioRecorder == null) {
synchronized (recordingLock) {
audioRecorder = new Recorder(recordingFile, "au", mediaInfo);
Logger.println("starting conference recorder for " + recordingFile + " " + mediaInfo);
this.recordingFile = recordingFile;
}
}
}
use of com.sun.voip.Recorder in project Openfire by igniterealtime.
the class MemberSender method setRecordToMember.
public void setRecordToMember(boolean enabled, String recordingFile, String recordingType) throws IOException {
synchronized (recordingLock) {
if (enabled == false) {
if (recorder != null) {
recorder.done();
}
cp.setToRecordingFile(null);
return;
}
if (recordingType == null) {
recordingType = "";
}
recordRtp = false;
if (recordingType.equalsIgnoreCase("Rtp")) {
recordRtp = true;
}
recorder = new Recorder(cp.getRecordDirectory(), recordingFile, recordingType, myMediaInfo);
cp.setToRecordingFile(recordingFile);
cp.setToRecordingType(recordingType);
}
}
use of com.sun.voip.Recorder in project Openfire by igniterealtime.
the class MemberReceiver method setRecordFromMember.
public void setRecordFromMember(boolean enabled, String recordingFile, String recordingType) throws IOException {
if (doNotRecord()) {
if (enabled) {
Logger.println("Call " + cp + " doesn't allow recording.");
enabled = false;
}
}
if (recorder != null) {
recorder.done();
recorder = null;
}
synchronized (recordingLock) {
if (enabled == false) {
cp.setFromRecordingFile(null);
return;
}
if (recordingType == null) {
recordingType = "Au";
}
recordRtp = false;
if (recordingType.equalsIgnoreCase("Rtp")) {
recordRtp = true;
}
synchronized (recordingLock) {
MediaInfo m;
try {
if (recordingType.equalsIgnoreCase("Rtp")) {
m = SdpManager.findMediaInfo(myMediaInfo.getEncoding(), myMediaInfo.getSampleRate(), myMediaInfo.getChannels());
} else {
m = SdpManager.findMediaInfo(RtpPacket.PCM_ENCODING, conferenceManager.getMediaInfo().getSampleRate(), conferenceManager.getMediaInfo().getChannels());
}
} catch (ParseException e) {
Logger.println("Can't record rtp to " + recordingFile + " " + e.getMessage());
throw new IOException(e.getMessage());
}
Logger.println("Recording media " + m);
recorder = new Recorder(cp.getRecordDirectory(), recordingFile, recordingType, m);
cp.setFromRecordingFile(recordingFile);
cp.setFromRecordingType(recordingType);
}
}
}
Aggregations