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

Method main

samples/QwenLiveQuickStart.java:27–44  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

25 private static final int FRAME_BYTES = INPUT_BYTES_PER_SECOND / 10;
26
27 public static void main(String[] args) throws Exception {
28 if (args.length < 4 || args.length > 6) {
29 System.out.println("Usage: QwenLiveQuickStart <workspaceId> <backendModel> <input.pcm> <output.pcm> [idleSeconds=3] [timeoutSeconds=90]");
30 System.exit(2);
31 return;
32 }
33 long idleMs = args.length > 4 ? Math.multiplyExact(Long.parseLong(args[4]), 1000) : 3000;
34 long timeoutMs = args.length > 5 ? Math.multiplyExact(Long.parseLong(args[5]), 1000) : 90000;
35 QwenLiveConnectionParam param = QwenLiveConnectionParam.builder().model("qwen-live").workspaceId(args[0]).build();
36 try {
37 run(param, args[1], Paths.get(args[2]), Paths.get(args[3]), idleMs, timeoutMs);
38 System.out.println("Saved raw PCM: " + args[3] + " (stopped by audio idle window, not a server done event)");
39 } catch (Exception failure) {
40 failure.printStackTrace();
41 System.exit(1);
42 }
43 System.exit(0);
44 }
45
46 static void run(QwenLiveConnectionParam param, String backendModel, Path input, Path output,
47 long idleMs, long timeoutMs) throws Exception {

Callers

nothing calls this directly

Calls 5

runMethod · 0.95
builderMethod · 0.80
buildMethod · 0.65
modelMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected