mirror of
https://github.com/2noise/ChatTTS.git
synced 2026-09-21 04:28:02 +08:00
chore(format): run black on main (#443)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
github-actions[bot]
parent
0b4a6867f8
commit
93db24b4b2
+9
-2
@@ -16,6 +16,7 @@ from tools.logger import get_logger
|
||||
|
||||
logger = get_logger("Command")
|
||||
|
||||
|
||||
def save_wav_file(wav, index):
|
||||
wav_filename = f"output_audio_{index}.wav"
|
||||
with wave.open(wav_filename, "wb") as wf:
|
||||
@@ -25,6 +26,7 @@ def save_wav_file(wav, index):
|
||||
wf.writeframes(unsafe_float_to_int16(wav))
|
||||
logger.info(f"Audio saved to {wav_filename}")
|
||||
|
||||
|
||||
def main(texts: list[str]):
|
||||
logger.info("Text input: %s", str(texts))
|
||||
|
||||
@@ -42,10 +44,15 @@ def main(texts: list[str]):
|
||||
for index, wav in enumerate(wavs):
|
||||
save_wav_file(wav, index)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
logger.info("Starting the TTS application...")
|
||||
parser = argparse.ArgumentParser(description='ChatTTS Command', usage="--stream hello, my name is bob.")
|
||||
parser.add_argument("text", help="Original text", default='YOUR TEXT HERE', nargs='*')
|
||||
parser = argparse.ArgumentParser(
|
||||
description="ChatTTS Command", usage="--stream hello, my name is bob."
|
||||
)
|
||||
parser.add_argument(
|
||||
"text", help="Original text", default="YOUR TEXT HERE", nargs="*"
|
||||
)
|
||||
args = parser.parse_args()
|
||||
main(args.text)
|
||||
logger.info("TTS application finished.")
|
||||
|
||||
Reference in New Issue
Block a user