Add MiniMax text to speech support to the speech generation path - #9825
Open
octo-patch wants to merge 1 commit into
Open
Add MiniMax text to speech support to the speech generation path#9825octo-patch wants to merge 1 commit into
octo-patch wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason: add MiniMax text to speech support to the existing speech generation path
Summary
jeecg.ai-chat.ai-model-voice.providerisMINIMAX, keeping the current OpenAI compatible/audio/speechbranch as the default so the voice module and the video dubbing caller are unchanged.MiniMaxVoiceApiwith the regional/v1/t2a_v2endpoints, the accepted speech models and thedefault model, the documented request fields (
model,text,stream,output_format,voice_setting,audio_setting) and Bearer authorization.base_resp.status_code, then decodethe hex encoded
data.audiopayload and write it to the target file, reportingdata.statuswhen noaudio is returned.
full operation url) so the endpoint is taken from configuration rather than assumed, and clamp the
configured speed and decibel volume gain into the ranges the operation accepts.
Changes
jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/voice/util/MiniMaxVoiceApi.java(new)jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/voice/util/VoiceApiHelper.javajeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/test/java/org/jeecg/modules/airag/voice/util/MiniMaxVoiceApiTest.java(new)Verification
javaccompile of the changed speech sources together withAiChatConfigon Java 21: passed.MiniMaxVoiceApiTeston the JUnit 5 console launcher: 16 tests passed. The suite drivesVoiceApiHelper.generateAudioend to end against a local http server and asserts the request path,the Bearer header, the request body fields, and that the decoded audio bytes reach the output file.
It also covers a failed
base_resp.status_code, a non 200 response, malformed hex payloads, and aregression test that a non MiniMax provider still calls
/audio/speech.not claimed here.