File size: 871 Bytes
960b1a0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# tts_test_run.py

import os
from utils.config_loader import ConfigLoader
from synthetic_utils.dia_tts_wrapper import DiaTTSWrapper
from generate_synthetic_dataset import PARALINGUISTIC_MARKERS

# Загружаем конфиг
config = ConfigLoader("config.toml")

# Настройка TTS
tts = DiaTTSWrapper(device=config.whisper_device)

# Пример текста и эмоции
text = "I'm just testing how this emotional voice sounds."
emotion = "neutral"  # можно: neutral, happy, sad, anger, fear, surprise, disgust
marker = PARALINGUISTIC_MARKERS.get(emotion, "")

# Генерация и сохранение
tts.generate_and_save_audio(
    text=text,
    paralinguistic=marker,
    out_dir="tts_test_outputs",
    filename_prefix=f"test_{emotion}",
    max_duration=5.0
)

print(f"✅ Аудио для эмоции '{emotion}' сохранено.")