TtsRequest.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package com.ruoyi.aicall.tts.doubao;
  2. import com.alibaba.fastjson.annotation.JSONField;
  3. import lombok.Builder;
  4. import lombok.Data;
  5. @Data
  6. @Builder
  7. public class TtsRequest {
  8. @JSONField(name = "app")
  9. private App app;
  10. @JSONField(name = "user")
  11. private User user;
  12. @JSONField(name = "audio")
  13. private Audio audio;
  14. @JSONField(name = "request")
  15. private Request request;
  16. @Data
  17. @Builder
  18. public static class App {
  19. @JSONField(name = "appid")
  20. private String appid;
  21. @JSONField(name = "token")
  22. private String token; // 目前未生效,使用默认值即可
  23. @JSONField(name = "cluster")
  24. private String cluster;
  25. }
  26. @Data
  27. @Builder
  28. public static class User {
  29. @JSONField(name = "uid")
  30. private String uid;
  31. }
  32. @Data
  33. @Builder
  34. public static class Audio {
  35. @JSONField(name = "voice_type")
  36. private String voiceType;
  37. @JSONField(name = "voice")
  38. private String voice;
  39. @JSONField(name = "encoding")
  40. private String encoding;
  41. @JSONField(name = "speed_ratio")
  42. private Double speedRatio;
  43. @JSONField(name = "volume_ratio")
  44. private Double volumeRatio;
  45. @JSONField(name = "pitch_ratio")
  46. private Double pitchRatio;
  47. @JSONField(name = "emotion")
  48. private String emotion;
  49. @JSONField(name = "language")
  50. private String language;
  51. @JSONField(name = "language")
  52. private Integer rate;
  53. }
  54. @Data
  55. @Builder
  56. public static class Request {
  57. @JSONField(name = "reqid")
  58. private String reqID;
  59. @JSONField(name = "text")
  60. private String text;
  61. @JSONField(name = "text_type")
  62. private String textType;
  63. @JSONField(name = "operation")
  64. private String operation;
  65. @JSONField(name = "silence_duration")
  66. private Integer silenceDuration;
  67. }
  68. }