diff --git a/src/main/kotlin/com/sangdol/text_to_speech/GoogleTtsConfig.kt b/src/main/kotlin/com/sangdol/text_to_speech/GoogleTtsConfig.kt new file mode 100644 index 0000000..1cdedfa --- /dev/null +++ b/src/main/kotlin/com/sangdol/text_to_speech/GoogleTtsConfig.kt @@ -0,0 +1,44 @@ +package com.sangdol.text_to_speech + +import com.google.cloud.texttospeech.v1.TextToSpeechClient +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration + +@Configuration +class GoogleTtsConfig { + + @Bean + fun textToSpeechClient(): TextToSpeechClient = TextToSpeechClient.create() +} + +enum class TtsLanguageCode( + val code: String +) { + ENGLISH_US("en-US") +} + +sealed interface VoiceType { + val identifier: String + val name: String +} + +enum class Neural2MaleVoice( + override val identifier: String, +): VoiceType { + TYPE_A("en-US-Neural2-A"), + TYPE_D("en-US-Neural2-D"), + TYPE_I("en-US-Neural2-I"), + TYPE_J("en-US-Neural2-J"), + ; +} + +enum class Neural2FemaleVoice( + override val identifier: String +): VoiceType { + TYPE_C("en-US-Neural2-C"), + TYPE_E("en-US-Neural2-E"), + TYPE_F("en-US-Neural2-F"), + TYPE_G("en-US-Neural2-G"), + TYPE_H("en-US-Neural2-H"), + ; +}