@@ -25,15 +25,54 @@ public class QwenTtsRealtimeConfig {
2525 @ Builder .Default String mode = "server_commit" ;
2626 /** languageType for tts */
2727 @ Builder .Default String languageType = null ;
28+
29+ /** sampleRate for tts , range [8000,16000,22050,24000,44100,48000]. default is 24000 */
30+ @ Builder .Default Integer sampleRate = null ;
31+
32+ /** speechRate for tts , range [0.5~2.0],default is 1.0 */
33+ @ Builder .Default Float speechRate = null ;
34+
35+ /** volume for tts , range [0~100],default is 50 */
36+ @ Builder .Default Integer volume = null ;
37+
38+ /** format for tts, support mp3,wav,pcm,opus,default is pcm */
39+ @ Builder .Default String format = null ;
40+
41+ /** pitchRate for tts , range [0.5~2.0],default is 1.0 */
42+ @ Builder .Default Float pitchRate = null ;
43+
44+ /** bitRate for tts , support 6~510,default is 128kbps. only work on format: opus/mp3 */
45+ @ Builder .Default Integer bitRate = null ;
46+
2847 /** The extra parameters. */
2948 @ Builder .Default Map <String , Object > parameters = null ;
3049
3150 public JsonObject getConfig () {
3251 Map <String , Object > config = new HashMap <>();
3352 config .put (QwenTtsRealtimeConstants .VOICE , voice );
3453 config .put (QwenTtsRealtimeConstants .MODE , mode );
35- config .put (QwenTtsRealtimeConstants .RESPONSE_FORMAT , responseFormat .getFormat ());
36- config .put (QwenTtsRealtimeConstants .SAMPLE_RATE , responseFormat .getSampleRate ());
54+ if (this .format != null ) {
55+ config .put (QwenTtsRealtimeConstants .RESPONSE_FORMAT , this .format );
56+ } else {
57+ config .put (QwenTtsRealtimeConstants .RESPONSE_FORMAT , responseFormat .getFormat ());
58+ }
59+ if (this .sampleRate != null ) {
60+ config .put (QwenTtsRealtimeConstants .SAMPLE_RATE , this .sampleRate );
61+ } else {
62+ config .put (QwenTtsRealtimeConstants .SAMPLE_RATE , responseFormat .getSampleRate ());
63+ }
64+ if (this .speechRate != null ) {
65+ config .put (QwenTtsRealtimeConstants .SPEECH_RATE , this .speechRate );
66+ }
67+ if (this .pitchRate != null ) {
68+ config .put (QwenTtsRealtimeConstants .PITCH_RATE , this .pitchRate );
69+ }
70+ if (this .volume != null ) {
71+ config .put (QwenTtsRealtimeConstants .VOLUME , this .volume );
72+ }
73+ if (this .bitRate != null ) {
74+ config .put (QwenTtsRealtimeConstants .BIT_RATE , this .bitRate );
75+ }
3776 if (languageType != null ) {
3877 config .put (QwenTtsRealtimeConstants .LANGUAGE_TYPE ,languageType );
3978 }
0 commit comments