(Path pcm)
| 167 | } |
| 168 | |
| 169 | private static void streamAudio(Path pcm) throws Exception { |
| 170 | byte[] frame = new byte[FRAME_BYTES]; |
| 171 | long frames = 0; |
| 172 | try (InputStream in = Files.newInputStream(pcm)) { |
| 173 | int read; |
| 174 | while (running.get() && (read = in.read(frame)) > 0) { |
| 175 | conversation.appendAudioBytes(frame, 0, read); |
| 176 | frames++; |
| 177 | Thread.sleep(FRAME_INTERVAL_MS); |
| 178 | } |
| 179 | } |
| 180 | System.out.println("sent audio frames: " + frames); |
| 181 | } |
| 182 | |
| 183 | private static void simulateExternalAgent() { |
| 184 | try { |
no test coverage detected