import os
from shaonianzhentan import load_content, md5, save_content, bash

text = '测试一下，123'
tts_name = md5(text)
tts_file = f'tts/tts_{tts_name}.mp3'
if os.path.exists(tts_file):
    print(tts_file)
else:
    content = load_content('tts.sh')
    sh_content = content.replace('$TTS_PATH', tts_file).replace('$TTS_TEXT', text)
    sh_file = f'tts_{tts_name}.sh'
    save_content(sh_file, sh_content)
    print(bash(f'bash {sh_file}'))



import os
from shaonianzhentan import load_content, md5, save_content, bash

text = '测试一下，123'
tts_name = md5(text)
tts_file = f'tts/tts_{tts_name}.mp3'
if os.path.exists(tts_file):
    print(tts_file)
else:
    content = load_content('tts.sh')
    sh_content = content.replace('$TTS_PATH', tts_file).replace('$TTS_TEXT', text)
    sh_file = f'tts_{tts_name}.sh'
    save_content(sh_file, sh_content)
    print(bash(f'bash {sh_file}'))


