File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/main/java/me/dynmie/monolizer Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1212import javax .sound .sampled .*;
1313import java .awt .image .BufferedImage ;
1414import java .io .File ;
15+ import java .io .PrintWriter ;
1516import java .nio .ByteBuffer ;
1617import java .nio .ShortBuffer ;
1718import java .util .Scanner ;
@@ -120,6 +121,8 @@ public static void main(String[] args) throws InterruptedException {
120121
121122 long maxReadAheadBufferMicros = TimeUnit .MILLISECONDS .toMicros (1000 );
122123
124+ PrintWriter writer = new PrintWriter (System .out , false );
125+
123126 long lastTimestamp = -1L ;
124127 while (!Thread .interrupted ()) {
125128 Frame frame = grabber .grab ();
@@ -157,8 +160,8 @@ public static void main(String[] args) throws InterruptedException {
157160 String text = FrameUtils .convertFrameToText (image , col );
158161
159162 ConsoleUtils .resetCursorPosition ();
160- System . out .append (text );
161- System . out .flush ();
163+ writer .append (text );
164+ writer .flush ();
162165 });
163166 } else if (frame .samples != null ) { // if frame is audio frame
164167 if (audioLine == null ) {
You can’t perform that action at this time.
0 commit comments