get_speaker_gender.py 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. import os
  2. voice_to_gender_dict = {
  3. "v2/en_speaker_0": "Male",
  4. "v2/en_speaker_1": "Male",
  5. "v2/en_speaker_2": "Male",
  6. "v2/en_speaker_3": "Male",
  7. "v2/en_speaker_4": "Male",
  8. "v2/en_speaker_5": "Male",
  9. "v2/en_speaker_6": "Male",
  10. "v2/en_speaker_7": "Male",
  11. "v2/en_speaker_8": "Male",
  12. "v2/en_speaker_9": "Female",
  13. "v2/zh_speaker_0": "Male",
  14. "v2/zh_speaker_1": "Male",
  15. "v2/zh_speaker_2": "Male",
  16. "v2/zh_speaker_3": "Male",
  17. "v2/zh_speaker_4": "Female",
  18. "v2/zh_speaker_5": "Male",
  19. "v2/zh_speaker_6": "Female",
  20. "v2/zh_speaker_7": "Female",
  21. "v2/zh_speaker_8": "Male",
  22. "v2/zh_speaker_9": "Female",
  23. "v2/fr_speaker_0": "Male",
  24. "v2/fr_speaker_1": "Female",
  25. "v2/fr_speaker_2": "Female",
  26. "v2/fr_speaker_3": "Male",
  27. "v2/fr_speaker_4": "Male",
  28. "v2/fr_speaker_5": "Female",
  29. "v2/fr_speaker_6": "Male",
  30. "v2/fr_speaker_7": "Male",
  31. "v2/fr_speaker_8": "Male",
  32. "v2/fr_speaker_9": "Male",
  33. "v2/de_speaker_0": "Male",
  34. "v2/de_speaker_1": "Male",
  35. "v2/de_speaker_2": "Male",
  36. "v2/de_speaker_3": "Female",
  37. "v2/de_speaker_4": "Male",
  38. "v2/de_speaker_5": "Male",
  39. "v2/de_speaker_6": "Male",
  40. "v2/de_speaker_7": "Male",
  41. "v2/de_speaker_8": "Female",
  42. "v2/de_speaker_9": "Male",
  43. "v2/hi_speaker_0": "Female",
  44. "v2/hi_speaker_1": "Female",
  45. "v2/hi_speaker_2": "Male",
  46. "v2/hi_speaker_3": "Female",
  47. "v2/hi_speaker_4": "Female",
  48. "v2/hi_speaker_5": "Male",
  49. "v2/hi_speaker_6": "Male",
  50. "v2/hi_speaker_7": "Male",
  51. "v2/hi_speaker_8": "Male",
  52. "v2/hi_speaker_9": "Female",
  53. "v2/it_speaker_0": "Male",
  54. "v2/it_speaker_1": "Male",
  55. "v2/it_speaker_2": "Female",
  56. "v2/it_speaker_3": "Male",
  57. "v2/it_speaker_4": "Male",
  58. "v2/it_speaker_5": "Male",
  59. "v2/it_speaker_6": "Male",
  60. "v2/it_speaker_7": "Female",
  61. "v2/it_speaker_8": "Male",
  62. "v2/it_speaker_9": "Female",
  63. "v2/ja_speaker_0": "Female",
  64. "v2/ja_speaker_1": "Female",
  65. "v2/ja_speaker_2": "Male",
  66. "v2/ja_speaker_3": "Female",
  67. "v2/ja_speaker_4": "Female",
  68. "v2/ja_speaker_5": "Female",
  69. "v2/ja_speaker_6": "Male",
  70. "v2/ja_speaker_7": "Female",
  71. "v2/ja_speaker_8": "Female",
  72. "v2/ja_speaker_9": "Female",
  73. "v2/ko_speaker_0": "Female",
  74. "v2/ko_speaker_1": "Male",
  75. "v2/ko_speaker_2": "Male",
  76. "v2/ko_speaker_3": "Male",
  77. "v2/ko_speaker_4": "Male",
  78. "v2/ko_speaker_5": "Male",
  79. "v2/ko_speaker_6": "Male",
  80. "v2/ko_speaker_7": "Male",
  81. "v2/ko_speaker_8": "Male",
  82. "v2/ko_speaker_9": "Male",
  83. "v2/pl_speaker_0": "Male",
  84. "v2/pl_speaker_1": "Male",
  85. "v2/pl_speaker_2": "Male",
  86. "v2/pl_speaker_3": "Male",
  87. "v2/pl_speaker_4": "Female",
  88. "v2/pl_speaker_5": "Male",
  89. "v2/pl_speaker_6": "Female",
  90. "v2/pl_speaker_7": "Male",
  91. "v2/pl_speaker_8": "Male",
  92. "v2/pl_speaker_9": "Female",
  93. "v2/pt_speaker_0": "Male",
  94. "v2/pt_speaker_1": "Male",
  95. "v2/pt_speaker_2": "Male",
  96. "v2/pt_speaker_3": "Male",
  97. "v2/pt_speaker_4": "Male",
  98. "v2/pt_speaker_5": "Male",
  99. "v2/pt_speaker_6": "Male",
  100. "v2/pt_speaker_7": "Male",
  101. "v2/pt_speaker_8": "Male",
  102. "v2/pt_speaker_9": "Male",
  103. "v2/ru_speaker_0": "Male",
  104. "v2/ru_speaker_1": "Male",
  105. "v2/ru_speaker_2": "Male",
  106. "v2/ru_speaker_3": "Male",
  107. "v2/ru_speaker_4": "Male",
  108. "v2/ru_speaker_5": "Female",
  109. "v2/ru_speaker_6": "Female",
  110. "v2/ru_speaker_7": "Male",
  111. "v2/ru_speaker_8": "Male",
  112. "v2/ru_speaker_9": "Female",
  113. "v2/es_speaker_0": "Male",
  114. "v2/es_speaker_1": "Male",
  115. "v2/es_speaker_2": "Male",
  116. "v2/es_speaker_3": "Male",
  117. "v2/es_speaker_4": "Male",
  118. "v2/es_speaker_5": "Male",
  119. "v2/es_speaker_6": "Male",
  120. "v2/es_speaker_7": "Male",
  121. "v2/es_speaker_8": "Female",
  122. "v2/es_speaker_9": "Female",
  123. "v2/tr_speaker_0": "Male",
  124. "v2/tr_speaker_1": "Male",
  125. "v2/tr_speaker_2": "Male",
  126. "v2/tr_speaker_3": "Male",
  127. "v2/tr_speaker_4": "Female",
  128. "v2/tr_speaker_5": "Female",
  129. "v2/tr_speaker_6": "Male",
  130. "v2/tr_speaker_7": "Male",
  131. "v2/tr_speaker_8": "Male",
  132. "v2/tr_speaker_9": "Male",
  133. }
  134. def get_speaker_gender(history_prompt: str):
  135. return voice_to_gender_dict.get(history_prompt.replace(os.path.sep, "/"), "Unknown")