Skip to content

Commit

Permalink
2647 3 fix (#2651)
Browse files Browse the repository at this point in the history
* fix voises
  • Loading branch information
ElenaSpb authored Nov 25, 2024
1 parent 734debc commit a1d8520
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/main/kotlin/com/epam/brn/service/WordsService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,26 @@ class WordsService {

private val mapYandexLocaleManVoice =
mapOf(
BrnLocale.RU.locale to Voice.FILIPP,
BrnLocale.EN.locale to Voice.NICK,
BrnLocale.TR.locale to Voice.ERKANYAVAS
BrnLocale.RU.locale to listOf(Voice.FILIPP),
BrnLocale.EN.locale to listOf(Voice.NICK),
BrnLocale.TR.locale to listOf(Voice.ERKANYAVAS)
)

private val mapYandexLocaleWomanVoice =
mapOf(
BrnLocale.RU.locale to Voice.OKSANA,
BrnLocale.EN.locale to Voice.ALYSS,
BrnLocale.TR.locale to Voice.SILAERKAN
BrnLocale.RU.locale to listOf(Voice.OKSANA, Voice.marina, Voice.lera),
BrnLocale.EN.locale to listOf(Voice.ALYSS),
BrnLocale.TR.locale to listOf(Voice.SILAERKAN)
)

fun getDefaultManVoiceForLocale(locale: String): String =
mapYandexLocaleManVoice[locale]!!.name
mapYandexLocaleManVoice[locale]!!.first().name

fun getDefaultWomanVoiceForLocale(locale: String): String =
mapYandexLocaleWomanVoice[locale]!!.name
mapYandexLocaleWomanVoice[locale]!!.first().name

fun getVoicesForLocale(locale: String): List<String?> =
listOf(mapYandexLocaleManVoice[locale]?.name, mapYandexLocaleWomanVoice[locale]?.name)
fun getVoicesForLocale(locale: String): List<String> =
mapYandexLocaleManVoice[locale]!!.map { it.name }.plus(mapYandexLocaleWomanVoice[locale]!!.map { it.name })

fun getLocalFilePathForWord(audioFileMetaData: AudioFileMetaData) =
"$localFolderForFiles${getSubFilePathForWord(audioFileMetaData)}"
Expand Down

0 comments on commit a1d8520

Please sign in to comment.