const.go 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. package yask
  2. // Voice is struct of voice object into
  3. type Voice struct {
  4. NameEn string `json:"name_en"`
  5. MameRu string `json:"name_ru"`
  6. Voice string `json:"voice"`
  7. Lang string `json:"lang"`
  8. Male bool `json:"is_male"`
  9. Premium bool `json:"is_premium"`
  10. }
  11. const (
  12. // YaSTTUrl is url for send speech to text requests
  13. YaSTTUrl = "https://stt.api.cloud.yandex.net/speech/v1/stt:recognize"
  14. // YaTTSUrl is url for send text to speech requests
  15. YaTTSUrl = "https://tts.api.cloud.yandex.net/speech/v1/tts:synthesize"
  16. // Formats of audio
  17. // FormatLPCM is PCM audio format (wav) without wav header (more details in https://en.wikipedia.org/wiki/Pulse-code_modulation)
  18. FormatLPCM = "lpcm"
  19. // FormatOgg is audio ogg format
  20. FormatOgg = "oggopus"
  21. // Sample rates
  22. // Rate8k is rate of 8kHz
  23. Rate8k int = 8000
  24. // Rate16k is rate of 16kHz
  25. Rate16k int = 16000
  26. // Rate48k is rate of 48kHz
  27. Rate48k int = 48000
  28. // Languages
  29. // LangRU is russian language
  30. LangRU = "ru-Ru"
  31. // LangEN is english language
  32. LangEN = "en-US"
  33. // LangTR is turkish language
  34. LangTR = "tr-TR"
  35. // Speed constants
  36. // SpeedStandard is standart speed of voice (1.0)
  37. SpeedStandard float32 = 1.0
  38. // SpeedMostFastest is maximum speed voice (3.0)
  39. SpeedMostFastest float32 = 3.0
  40. // SpeedSlowest is minimum speed of voice (0.1)
  41. SpeedSlowest float32 = 0.1
  42. // Voice speeches
  43. // VoiceOksana is Oksana voice (russian, female, standard)
  44. VoiceOksana = "oksana"
  45. // VoiceJane is Jane voice (russian, female, standard)
  46. VoiceJane = "jane"
  47. // VoiceOmazh is Omazh voice (russian, female, standard)
  48. VoiceOmazh = "omazh"
  49. // VoiceZahar is Zahar voice (russian, male, standard)
  50. VoiceZahar = "zahar"
  51. // VoiceErmil is Ermil voice (russian, male, standard)
  52. VoiceErmil = "ermil"
  53. // VoiceSilaerkan is Silaerkan voice (turkish, female, standard)
  54. VoiceSilaerkan = "silaerkan"
  55. // VoiceErkanyavas is Erkanyavas voice (turkish, male, standard)
  56. VoiceErkanyavas = "erkanyavas"
  57. // VoiceAlyss is Alyss voice (english, female, standard)
  58. VoiceAlyss = "alyss"
  59. // VoiceNick is Nick voice (engish, male, standard)
  60. VoiceNick = "nick"
  61. // VoiceAlena is Alena voice (russian, female, premium)
  62. VoiceAlena = "alena"
  63. // VoiceFilipp is Filipp voice (russian, male, premium)
  64. VoiceFilipp = "filipp"
  65. // Voice emotions
  66. // EmotionGood is good voice emotion
  67. EmotionGood = "good"
  68. // EmotionEvil is evil voice emotion
  69. EmotionEvil = "evil"
  70. // EmotionNeutral is neutral voice emotion
  71. EmotionNeutral = "neutral"
  72. // Models for speech recodnition
  73. // TopicGeneral is current version of voice model (available in all languages)
  74. TopicGeneral = "general"
  75. // TopicGeneralRC is experimental version of voice model (russian language)
  76. TopicGeneralRC = "general:rc"
  77. // TopicGeneralDeprecated is deprecated version of voice model (russian language)
  78. TopicGeneralDeprecated = "general:deprecated"
  79. // TopicMaps is model for addresses anc company names
  80. TopicMaps = "maps"
  81. // This constants for use in voice selection filter
  82. // SexAll is male and female
  83. SexAll = 0
  84. // SexMale is male
  85. SexMale = 1
  86. // SexFemale is female
  87. SexFemale = 2
  88. )
  89. var (
  90. // voices is list of voice params
  91. voices = []Voice{
  92. Voice{"Oksana", "Оксана", VoiceOksana, LangRU, false, false},
  93. Voice{"Jane", "Джейн", VoiceJane, LangRU, false, false},
  94. Voice{"Omazh", "Омаж", VoiceOmazh, LangRU, false, false},
  95. Voice{"Zahar", "Захар", VoiceZahar, LangRU, true, false},
  96. Voice{"Ermil", "Эрмил", VoiceErmil, LangTR, true, false},
  97. Voice{"Sila Erkan", "Сыла Эркан", VoiceSilaerkan, LangTR, false, false},
  98. Voice{"Alyss", "Элис", VoiceAlyss, LangTR, false, false},
  99. Voice{"Nick", "Ник", VoiceNick, LangTR, true, false},
  100. Voice{"Alena", "Алёна", VoiceNick, LangRU, false, true},
  101. Voice{"Filipp", "Филипп", VoiceNick, LangRU, true, true},
  102. }
  103. )