-
Notifications
You must be signed in to change notification settings - Fork 24
funasr support payload.input and bug fix in transcription #231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| import com.alibaba.dashscope.exception.InputRequiredException; | ||
| import com.alibaba.dashscope.exception.NoApiKeyException; | ||
| import com.alibaba.dashscope.protocol.ApiServiceOption; | ||
| import com.alibaba.dashscope.protocol.ConnectionOptions; | ||
| import com.alibaba.dashscope.protocol.Protocol; | ||
| import com.alibaba.dashscope.protocol.StreamingMode; | ||
| import com.google.gson.Gson; | ||
|
|
@@ -85,6 +86,9 @@ public static RecognitionParamWithStream FromRecognitionParam( | |
| if (param.getPhraseId() != null && !param.getPhraseId().isEmpty()) { | ||
| recognitionParamWithStream.setPhraseId(param.getPhraseId()); | ||
| } | ||
| if (param.getInputs() != null && !param.getInputs().isEmpty()) { | ||
| recognitionParamWithStream.setInput(param.getInputs()); | ||
| } | ||
|
|
||
| return recognitionParamWithStream; | ||
| } | ||
|
|
@@ -103,6 +107,23 @@ public Recognition() { | |
| duplexApi = new SynchronizeFullDuplexApi<>(serviceOption); | ||
| } | ||
|
|
||
| public Recognition(ConnectionOptions connectionOptions) { | ||
| serviceOption = | ||
| ApiServiceOption.builder() | ||
| .protocol(Protocol.WEBSOCKET) | ||
| .streamingMode(StreamingMode.DUPLEX) | ||
| .outputMode(OutputMode.ACCUMULATE) | ||
| .taskGroup(TaskGroup.AUDIO.getValue()) | ||
| .task(Task.ASR.getValue()) | ||
| .function(Function.RECOGNITION.getValue()) | ||
| .build(); | ||
| duplexApi = new SynchronizeFullDuplexApi<>(connectionOptions, serviceOption); | ||
| } | ||
|
|
||
| public void setWebsocketUrl(String websocketUrl) { | ||
| serviceOption.setBaseWebSocketUrl(websocketUrl); | ||
| } | ||
|
Comment on lines
+123
to
+125
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The If |
||
|
|
||
| public Flowable<RecognitionResult> streamCall( | ||
| RecognitionParam param, Flowable<ByteBuffer> audioFrame) | ||
| throws ApiException, NoApiKeyException { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.