MCPcopy Create free account
hub / github.com/dashscope/dashscope-sdk-java / streamAudio

Method streamAudio

samples/QwenLiveUsage.java:169–181  ·  view source on GitHub ↗
(Path pcm)

Source from the content-addressed store, hash-verified

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 {

Callers 1

mainMethod · 0.95

Calls 3

appendAudioBytesMethod · 0.80
getMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected