From 1abad2258d977100df25a4d63c0c3fc72d996092 Mon Sep 17 00:00:00 2001 From: pricelees Date: Wed, 20 Aug 2025 21:14:14 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Google=20Cloud=20TTS=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=EC=9D=84=20=EC=9C=84=ED=95=9C=20=ED=81=B4=EB=9D=BC?= =?UTF-8?q?=EC=9D=B4=EC=96=B8=ED=8A=B8=20=EC=84=A4=EC=A0=95=20=EB=B0=8F=20?= =?UTF-8?q?=EC=83=81=EC=88=98=20=EC=A0=95=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sangdol/text_to_speech/GoogleTtsConfig.kt | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/main/kotlin/com/sangdol/text_to_speech/GoogleTtsConfig.kt 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"), + ; +}