Spaces:
Runtime error
Runtime error
from modules.utils.CsvMgr import BaseManager | |
# speakers_mgr = BaseManager("./data/speakers.csv") | |
styles_mgr = BaseManager("./data/styles.csv") | |
if __name__ == "__main__": | |
# builtin style | |
styles = { | |
"advertisement_upbeat": { | |
"speed": 9, | |
"oral": 7, | |
"laugh": 2, | |
"break": 1, | |
"prefix": "兴奋的语气推广产品。", | |
}, | |
"affectionate": { | |
"speed": 6, | |
"oral": 8, | |
"laugh": 1, | |
"break": 2, | |
"prefix": "温暖亲切的语气。", | |
}, | |
"angry": { | |
"speed": 7, | |
"oral": 5, | |
"break": 3, | |
"prefix": "生气厌恶的语气。", | |
}, | |
"assistant": { | |
"speed": 5, | |
"oral": 7, | |
"laugh": 1, | |
"break": 2, | |
"prefix": "热情轻松的语气。", | |
}, | |
"calm": { | |
"speed": 0, | |
"oral": 4, | |
"break": 4, | |
"prefix": "沉着冷静的语气。", | |
}, | |
"chat": { | |
"speed": 6, | |
"oral": 9, | |
"laugh": 1, | |
"break": 2, | |
"prefix": "轻松随意的语气。", | |
}, | |
"cheerful": { | |
"speed": 7, | |
"oral": 8, | |
"laugh": 2, | |
"break": 2, | |
"prefix": "积极愉快的语气。", | |
}, | |
"customerservice": { | |
"speed": 5, | |
"oral": 6, | |
"laugh": 1, | |
"break": 5, | |
"prefix": "友好热情的语气。", | |
}, | |
"depressed": { | |
"speed": 2, | |
"oral": 3, | |
"break": 5, | |
"prefix": "忧郁沮丧的语气。", | |
}, | |
"disgruntled": { | |
"speed": 4, | |
"oral": 5, | |
"break": 4, | |
"prefix": "轻蔑抱怨的语气。", | |
}, | |
"documentary-narration": { | |
"speed": 4, | |
"oral": 4, | |
"break": 3, | |
"prefix": "轻松且信息丰富的语气。", | |
}, | |
"embarrassed": { | |
"speed": 3, | |
"oral": 3, | |
"break": 5, | |
"prefix": "不确定犹豫的语气。", | |
}, | |
"empathetic": { | |
"speed": 5, | |
"oral": 6, | |
"laugh": 1, | |
"break": 3, | |
"prefix": "关心理解的语气。", | |
}, | |
"envious": { | |
"speed": 5, | |
"oral": 5, | |
"laugh": 1, | |
"break": 2, | |
"prefix": "钦佩的语气。", | |
}, | |
"excited": { | |
"speed": 8, | |
"oral": 7, | |
"laugh": 2, | |
"break": 1, | |
"prefix": "乐观充满希望的语气。", | |
}, | |
"fearful": { | |
"speed": 9, | |
"oral": 6, | |
"break": 2, | |
"prefix": "恐惧紧张的语气。", | |
}, | |
"friendly": { | |
"speed": 6, | |
"oral": 7, | |
"laugh": 1, | |
"break": 2, | |
"prefix": "愉快温暖的语气。", | |
}, | |
"gentle": { | |
"speed": 4, | |
"oral": 5, | |
"laugh": 1, | |
"break": 3, | |
"prefix": "温和礼貌的语气。", | |
}, | |
"hopeful": { | |
"speed": 5, | |
"oral": 6, | |
"laugh": 1, | |
"break": 4, | |
"prefix": "温暖渴望的语气。", | |
}, | |
"lyrical": { | |
"speed": 3, | |
"oral": 4, | |
"break": 4, | |
"prefix": "优美感伤的语气。", | |
}, | |
"narration-professional": { | |
"speed": 5, | |
"oral": 3, | |
"break": 3, | |
"prefix": "专业客观的语气。", | |
}, | |
"narration-relaxed": { | |
"speed": 2, | |
"oral": 4, | |
"break": 3, | |
"prefix": "舒缓悦耳的语气。", | |
}, | |
"newscast": { | |
"speed": 6, | |
"oral": 4, | |
"break": 2, | |
"prefix": "正式专业的语气。", | |
}, | |
"newscast-casual": { | |
"speed": 5, | |
"oral": 5, | |
"break": 2, | |
"prefix": "随意的新闻语气。", | |
}, | |
"newscast-formal": { | |
"speed": 6, | |
"oral": 3, | |
"break": 2, | |
"prefix": "正式权威的语气。", | |
}, | |
"poetry-reading": { | |
"speed": 4, | |
"oral": 5, | |
"break": 3, | |
"prefix": "带情感和节奏的语气。", | |
}, | |
"sad": { | |
"speed": 0, | |
"oral": 3, | |
"break": 5, | |
"prefix": "悲伤的语气。", | |
}, | |
"serious": { | |
"speed": 5, | |
"oral": 3, | |
"break": 4, | |
"prefix": "严肃命令的语气。", | |
}, | |
"shouting": { | |
"speed": 7, | |
"oral": 6, | |
"break": 1, | |
"prefix": "努力让别人听清楚的语气。", | |
}, | |
"sports_commentary": { | |
"speed": 8, | |
"oral": 7, | |
"laugh": 1, | |
"break": 2, | |
"prefix": "轻松感兴趣的体育播报语气。", | |
}, | |
"sports_commentary_excited": { | |
"speed": 9, | |
"oral": 8, | |
"laugh": 2, | |
"break": 1, | |
"prefix": "快速充满活力的体育播报语气。", | |
}, | |
"whispering": { | |
"speed": 2, | |
"oral": 3, | |
"break": 4, | |
"prefix": "柔和的语气。", | |
}, | |
"terrified": { | |
"speed": 9, | |
"oral": 7, | |
"break": 1, | |
"prefix": "害怕的语气。", | |
}, | |
"unfriendly": { | |
"speed": 4, | |
"oral": 2, | |
"break": 3, | |
"prefix": "冷淡无情的语气。", | |
}, | |
} | |
styles_en = { | |
"advertisement_upbeat": { | |
"speed": 9, | |
"oral": 7, | |
"laugh": 2, | |
"break": 1, | |
"prefix": "Promote products or services with an excited and energetic tone.", | |
}, | |
"affectionate": { | |
"speed": 6, | |
"oral": 8, | |
"laugh": 1, | |
"break": 2, | |
"prefix": "Express a warm and affectionate tone with a higher pitch and volume. The speaker is in a state of capturing the listener's attention and is often likeable.", | |
}, | |
"angry": { | |
"speed": 7, | |
"oral": 5, | |
"break": 3, | |
"prefix": "Express an angry and disgusted tone.", | |
}, | |
"assistant": { | |
"speed": 5, | |
"oral": 7, | |
"laugh": 1, | |
"break": 2, | |
"prefix": "Digital assistant uses an enthusiastic and relaxed tone.", | |
}, | |
"calm": { | |
"speed": 0, | |
"oral": 4, | |
"break": 4, | |
"prefix": "Speak with a calm and composed attitude. The tone, pitch, and rhythm are much more consistent compared to other speech types.", | |
}, | |
"chat": { | |
"speed": 6, | |
"oral": 9, | |
"laugh": 1, | |
"break": 2, | |
"prefix": "Express a relaxed and casual tone.", | |
}, | |
"cheerful": { | |
"speed": 7, | |
"oral": 8, | |
"laugh": 2, | |
"break": 2, | |
"prefix": "Express a positive and cheerful tone.", | |
}, | |
"customerservice": { | |
"speed": 5, | |
"oral": 6, | |
"laugh": 1, | |
"break": 5, | |
"prefix": "Provide support to customers with a friendly and enthusiastic tone.", | |
}, | |
"depressed": { | |
"speed": 2, | |
"oral": 3, | |
"break": 5, | |
"prefix": "Express a depressed and downcast tone with lower pitch and volume.", | |
}, | |
"disgruntled": { | |
"speed": 4, | |
"oral": 5, | |
"break": 4, | |
"prefix": "Express a tone of contempt and complaint. This emotional voice exhibits displeasure and disdain.", | |
}, | |
"documentary-narration": { | |
"speed": 4, | |
"oral": 4, | |
"break": 3, | |
"prefix": "Narrate documentaries in a relaxed, interested, and informative style, suitable for documentary voiceovers, expert commentary, and similar content.", | |
}, | |
"embarrassed": { | |
"speed": 3, | |
"oral": 3, | |
"break": 5, | |
"prefix": "Express an uncertain, hesitant tone when the speaker feels uncomfortable.", | |
}, | |
"empathetic": { | |
"speed": 5, | |
"oral": 6, | |
"laugh": 1, | |
"break": 3, | |
"prefix": "Express care and understanding.", | |
}, | |
"envious": { | |
"speed": 5, | |
"oral": 5, | |
"laugh": 1, | |
"break": 2, | |
"prefix": "Express an admiring tone when you desire something others have.", | |
}, | |
"excited": { | |
"speed": 8, | |
"oral": 7, | |
"laugh": 2, | |
"break": 1, | |
"prefix": "Express an optimistic and hopeful tone. It seems something wonderful has happened, and the speaker is pleased.", | |
}, | |
"fearful": { | |
"speed": 9, | |
"oral": 6, | |
"break": 2, | |
"prefix": "Express a fearful and anxious tone with a higher pitch, higher volume, and faster speech rate. The speaker is in a state of tension and unease.", | |
}, | |
"friendly": { | |
"speed": 6, | |
"oral": 7, | |
"laugh": 1, | |
"break": 2, | |
"prefix": "Express a pleasant, delightful, and warm tone. It sounds sincere and full of concern.", | |
}, | |
"gentle": { | |
"speed": 4, | |
"oral": 5, | |
"laugh": 1, | |
"break": 3, | |
"prefix": "Express a gentle, polite, and pleasant tone with a lower pitch and volume.", | |
}, | |
"hopeful": { | |
"speed": 5, | |
"oral": 6, | |
"laugh": 1, | |
"break": 4, | |
"prefix": "Express a warm and desirous tone. It sounds like something good is going to happen to the speaker.", | |
}, | |
"lyrical": { | |
"speed": 3, | |
"oral": 4, | |
"break": 4, | |
"prefix": "Express emotions in a beautiful and sentimental way.", | |
}, | |
"narration-professional": { | |
"speed": 5, | |
"oral": 3, | |
"break": 3, | |
"prefix": "Read content in a professional and objective tone.", | |
}, | |
"narration-relaxed": { | |
"speed": 2, | |
"oral": 4, | |
"break": 3, | |
"prefix": "Express a soothing and pleasant tone when reading content.", | |
}, | |
"newscast": { | |
"speed": 6, | |
"oral": 4, | |
"break": 2, | |
"prefix": "Narrate news in a formal and professional tone.", | |
}, | |
"newscast-casual": { | |
"speed": 5, | |
"oral": 5, | |
"break": 2, | |
"prefix": "Deliver general news in a generic and casual tone.", | |
}, | |
"newscast-formal": { | |
"speed": 6, | |
"oral": 3, | |
"break": 2, | |
"prefix": "Deliver news in a formal, confident, and authoritative tone.", | |
}, | |
"poetry-reading": { | |
"speed": 4, | |
"oral": 5, | |
"break": 3, | |
"prefix": "Express an emotional and rhythmic tone when reading poetry.", | |
}, | |
"sad": {"speed": 0, "oral": 3, "break": 5, "prefix": "Express a sad tone."}, | |
"serious": { | |
"speed": 5, | |
"oral": 3, | |
"break": 4, | |
"prefix": "Express a serious and commanding tone. The speaker's voice is usually stiff, and the pace is not as relaxed.", | |
}, | |
"shouting": { | |
"speed": 7, | |
"oral": 6, | |
"break": 1, | |
"prefix": "Express a tone that sounds like the voice is far away or in another place, trying hard to be heard clearly.", | |
}, | |
"sports_commentary": { | |
"speed": 8, | |
"oral": 7, | |
"laugh": 1, | |
"break": 2, | |
"prefix": "Express a relaxed yet interested tone, used for sports commentary.", | |
}, | |
"sports_commentary_excited": { | |
"speed": 9, | |
"oral": 8, | |
"laugh": 2, | |
"break": 1, | |
"prefix": "Commentate on exciting moments in sports with a fast and energetic tone.", | |
}, | |
"whispering": { | |
"speed": 2, | |
"oral": 3, | |
"break": 4, | |
"prefix": "Express a soft tone, trying to make a quiet and gentle sound.", | |
}, | |
"terrified": { | |
"speed": 9, | |
"oral": 7, | |
"break": 1, | |
"prefix": "Express a terrified tone, with fast speech and trembling voice. It sounds like the speaker is in an unstable, frantic state.", | |
}, | |
"unfriendly": { | |
"speed": 4, | |
"oral": 2, | |
"break": 3, | |
"prefix": "Express a cold and unfeeling tone.", | |
}, | |
} | |
id = 0 | |
for k, v in styles.items(): | |
v.pop("prefix") | |
styles_mgr.add_item(id, k, f"builtin style {k}", v) | |
id += 1 | |
# for k, v in styles_en.items(): | |
# styles_mgr.add_item(id, f"en_{k}", f"builtin style {k}", v) | |
# id += 1 | |