80 lines
2.5 KiB
Python
80 lines
2.5 KiB
Python
#!/usr/bin/env python3
|
||
# -*- coding: utf-8 -*-
|
||
"""
|
||
角色初始化脚本
|
||
为播客中的各个角色进行初始化设置
|
||
"""
|
||
|
||
import os
|
||
|
||
class PodcastCharacter:
|
||
def __init__(self, name, role, accent, voice_model, description):
|
||
self.name = name
|
||
self.role = role
|
||
self.accent = accent
|
||
self.voice_model = voice_model
|
||
self.description = description
|
||
|
||
def __str__(self):
|
||
return f"{self.name} ({self.role}): {self.description}\n 推荐语音: {self.voice_model}\n 风格: {self.accent}\n"
|
||
|
||
# 定义所有角色
|
||
characters = [
|
||
PodcastCharacter(
|
||
name="Sonia",
|
||
role="Host (主持人)",
|
||
accent="冷静、客观、甚至带点冷幽默",
|
||
voice_model="Edge TTS 的 en-GB-RyanNeural(男)或 en-US-JennyNeural(女)",
|
||
description="主持人,负责引导对话"
|
||
),
|
||
PodcastCharacter(
|
||
name="Graham",
|
||
role="硅谷",
|
||
accent="典型的 American Tech Bro,语速快,自信",
|
||
voice_model="Edge TTS 的 en-US-GuyNeural 或 en-US-ChristopherNeural",
|
||
description="硅谷科技人士视角"
|
||
),
|
||
PodcastCharacter(
|
||
name="Dmitri",
|
||
role="俄罗斯",
|
||
accent="深沉,重音在后",
|
||
voice_model="Edge TTS 没有原生俄式英语。替代方案:用 en-IE-ConnorNeural(爱尔兰音)",
|
||
description="俄罗斯视角"
|
||
),
|
||
PodcastCharacter(
|
||
name="Amita",
|
||
role="印度",
|
||
accent="语速快,清晰的印度口音",
|
||
voice_model="Edge TTS 的 en-IN-NeerjaNeural(女)或 en-IN-PrabhatNeural(男)",
|
||
description="印度视角"
|
||
),
|
||
PodcastCharacter(
|
||
name="穆罕默德",
|
||
role="中东",
|
||
accent="沧桑,缓慢",
|
||
voice_model="en-EG-SalmaNeural(埃及英语)或其他深沉男声",
|
||
description="中东视角"
|
||
),
|
||
PodcastCharacter(
|
||
name="Author",
|
||
role="作者",
|
||
accent="分析性,权威性",
|
||
voice_model="Edge TTS 的 en-US-GuyNeural",
|
||
description="本书作者,提供深入分析"
|
||
)
|
||
]
|
||
|
||
def initialize_characters():
|
||
"""初始化所有角色"""
|
||
print("=== 播客角色初始化 ===\n")
|
||
|
||
for i, character in enumerate(characters, 1):
|
||
print(f"{i}. {character}")
|
||
print()
|
||
|
||
print("=== 初始化完成 ===")
|
||
print("\n所有角色已根据 chapter8.md 中的设定完成初始化。")
|
||
print("音频模型已指定,可根据需要生成对应语音。")
|
||
|
||
if __name__ == "__main__":
|
||
initialize_characters() |