from typecast import Typecastfrom typecast.models import TTSRequest, SmartPromptclient = Typecast()response = client.text_to_speech(TTSRequest( text="Everything is going to be okay.", model="ssfm-v30", voice_id="tc_672c5f5ce59fac2a48faeaee", prompt=SmartPrompt( emotion_type="smart", previous_text="I just got the best news!", # 선택적 문맥 next_text="I can't wait to celebrate!" # 선택적 문맥 )))
프리셋 값으로 감정을 명시적으로 설정합니다:
복사
AI에게 묻기
from typecast import Typecastfrom typecast.models import TTSRequest, PresetPromptclient = Typecast()response = client.text_to_speech(TTSRequest( text="I am so excited to show you these features!", model="ssfm-v30", voice_id="tc_672c5f5ce59fac2a48faeaee", prompt=PresetPrompt( emotion_type="preset", emotion_preset="happy", # normal, happy, sad, angry, whisper, toneup, tonedown emotion_intensity=1.5 # 범위: 0.0 ~ 2.0 )))
from typecast import Typecastfrom typecast.models import VoicesV2Filter, TTSModel, GenderEnum, AgeEnumclient = Typecast()# 모든 음성 가져오기voices = client.voices_v2()# 기준으로 필터링filtered = client.voices_v2(VoicesV2Filter( model=TTSModel.SSFM_V30, gender=GenderEnum.FEMALE, age=AgeEnum.YOUNG_ADULT))# 음성 정보 표시for voice in voices: print(f"ID: {voice.voice_id}, Name: {voice.voice_name}") print(f"Gender: {voice.gender}, Age: {voice.age}") print(f"Models: {', '.join(m.version.value for m in voice.models)}") print(f"Use cases: {voice.use_cases}")