//Cut away the piece at the end
File outputFullWavCuttedFile = new File(outputFullWav);
AudioInputStream aInputStream = AudioSystem.getAudioInputStream(outputFullWavCuttedFile);
AudioFormat aFormat = aInputStream.getFormat();
long frameLength = aInputStream.getFrameLength();
float frameRate = aFormat.getFrameRate();
double audioLength = Math.round(frameLength / frameRate);
String newLength = ""+(new Float(audioLength)-((new Float(Math.abs(this.leftSideTime)))/1000));
log.debug("newLength :newLength: "+newLength);
String temporaryFullWaveAdd = outputFullWav;
String hashFileFullNameAdd = flvRecordingMetaData.getStreamName()
+ "_FULL_WAVE_CUT_LEFT.wav";
String outputFullWavAdd = streamFolderName + hashFileFullNameAdd;
String[] argv_add_sox = null;
if (this.leftSideTime > 0) {
argv_add_sox = new String[] { this.getPathToSoX(),
temporaryFullWaveAdd, outputFullWavAdd, "trim",
"0",newLength };
} else {
argv_add_sox = new String[] { this.getPathToSoX(),
temporaryFullWaveAdd, outputFullWavAdd, "trim",
cutSecond,""+audioLength };
}
log.debug("START addPadAddStringToWaves ################# ");
String padAddString = "";
for (int i = 0; i < argv_add_sox.length; i++) {
padAddString += " "+argv_add_sox[i];
log.debug(" i " + i + " argv-i " + argv_add_sox[i]);
}
log.debug("padAddString :LEFT: "+padAddString);
log.debug("END addPadAddStringToWaves ################# ");
returnLog.add(GenerateSWF.executeScript("addPadAddStringToAudio",argv_add_sox));
outputFullWav = outputFullWavAdd;
hashFileFullName = hashFileFullNameAdd;
}
}
if (flvRecordingMetaData.getInteriewPodId() == 2) {
//Right
if (this.rightSideTime != 0) {
String temporaryFullWave = outputFullWav;
String hashFileFullNameCut = flvRecordingMetaData.getStreamName()
+ "_FULL_WAVE_ADDED_RIGHT.wav";
String outputFullWavCut = streamFolderName + hashFileFullNameCut;
String cutSecond = ""+((new Float(Math.abs(this.rightSideTime)))/1000);
String[] argv_cut_sox = null;
if (this.rightSideTime > 0) {
argv_cut_sox = new String[] { this.getPathToSoX(),
temporaryFullWave, outputFullWavCut, "pad",
cutSecond,"0" };
} else {
argv_cut_sox = new String[] { this.getPathToSoX(),
temporaryFullWave, outputFullWavCut, "pad",
"0",cutSecond };
}
log.debug("START addPadCutStringToWaves ################# ");
String padCutString = "";
for (int i = 0; i < argv_cut_sox.length; i++) {
padCutString += " "+argv_cut_sox[i];
//log.debug(" i " + i + " argv-i " + argv_sox[i]);
}
log.debug("padCutString :RIGHT: "+padCutString);
log.debug("END addPadCutStringToWaves ################# ");
returnLog.add(GenerateSWF.executeScript("addPadCutStringToAudio",argv_cut_sox));
outputFullWav = outputFullWavCut;
hashFileFullName = hashFileFullNameCut;
//Cut away the piece at the end
File outputFullWavCuttedFile = new File(outputFullWav);
AudioInputStream aInputStream = AudioSystem.getAudioInputStream(outputFullWavCuttedFile);
AudioFormat aFormat = aInputStream.getFormat();
long frameLength = aInputStream.getFrameLength();
float frameRate = aFormat.getFrameRate();
double audioLength = Math.round(frameLength / frameRate);
String newLength = ""+(new Float(audioLength)-((new Float(Math.abs(this.leftSideTime)))/1000));