Commit 4ba90bb9 authored by petter's avatar petter

now also desktop recording can be merged from n files

git-svn-id: https://www2.in.tum.de/repos/ttt/trunk@167 0463f305-d864-43cb-8a47-61cf597d4139
parent d34dc249
...@@ -570,7 +570,7 @@ public class TTTProcessor { ...@@ -570,7 +570,7 @@ public class TTTProcessor {
ArrayList<Message> finalMessages = new ArrayList<Message>(); ArrayList<Message> finalMessages = new ArrayList<Message>();
ArrayList<byte[]> finalExtensions = new ArrayList<byte[]>(); ArrayList<byte[]> finalExtensions = new ArrayList<byte[]>();
//used to correct the timestamp //used to correct the timestamp
int duration = 1; int duration = 0;
Recording[] placeholderRecording = new Recording[desktopFiles.length]; Recording[] placeholderRecording = new Recording[desktopFiles.length];
...@@ -586,7 +586,9 @@ public class TTTProcessor { ...@@ -586,7 +586,9 @@ public class TTTProcessor {
} }
//finalExtensions.addAll(placeholderRecording[i].getExtensions()); //finalExtensions.addAll(placeholderRecording[i].getExtensions());
finalMessages.addAll(placeholderRecording[i].getMessages().getMessages()); finalMessages.addAll(placeholderRecording[i].getMessages().getMessages());
duration += (placeholderRecording[i].getMessages().get(placeholderRecording[i].getMessages().size()-1).getTimestamp()); System.out.println("Extended Desktop recording by "+ (placeholderRecording[i].getMessages().get(placeholderRecording[i].getMessages().size()-1).getTimestamp())/60000l +" minutes");
duration = (placeholderRecording[i].getMessages().get(placeholderRecording[i].getMessages().size()-1).getTimestamp());
} catch (Exception e) { } catch (Exception e) {
System.out.println("Error reading file: " + e); System.out.println("Error reading file: " + e);
......
...@@ -88,6 +88,7 @@ public class WavConcat { ...@@ -88,6 +88,7 @@ public class WavConcat {
chunk[0] = Offset[7]; chunk[0] = Offset[7];
durations[count++] = TimeUnit.SECONDS.toNanos((convertByteArrayToInt(chunk) / convertByteArrayToInt(rate))); durations[count++] = TimeUnit.SECONDS.toNanos((convertByteArrayToInt(chunk) / convertByteArrayToInt(rate)));
System.out.println(count+ "th Audiofile with length " + durations[count-1]/60000000000l +" sec");
}catch (FileNotFoundException e) { }catch (FileNotFoundException e) {
System.err.println("Error reading file: " + i.toString()); System.err.println("Error reading file: " + i.toString());
e.printStackTrace(); e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment