o
    i                     @   sB   d Z ddlZddlmZ ddlmZ dd Zedkre  dS dS )z$
Soprano TTS Command Line Interface
    N)
SopranoTTS)play_streamc                  C   s$  t jdd} | jddd | jdddd	d
 | jdddd | jdddg ddd | jdddg ddd | jddtddd | jddtdd d | jd!d"d#d$d% |  }t|j|j|j|j	|j
d&}td'|j d( |jr|j|jdd)}t| d S |j|j|jd* td+|j  d S ),NzSoprano Text-to-Speech CLI)descriptiontextzText to synthesize)helpz--outputz-oz
output.wavz+Output audio file path (non-streaming only))defaultr   z--model-pathz-mz(Path to local model directory (optional)z--devicez-dauto)r   cudacpumpszDevice to use for inference)r   choicesr   z	--backendz-b)r   transformerslmdeployzBackend to use for inferencez--cache-sizez-cd   z'Cache size in MB (for lmdeploy backend))typer   r   z--decoder-batch-sizez-bs   zBatch size when decoding audioz--streamingz-s
store_truez%Enable streaming playback to speakers)actionr   )backenddevicecache_size_mbdecoder_batch_size
model_pathzGenerating speech for: '')
chunk_size)out_pathzAudio saved to: )argparseArgumentParseradd_argumentint
parse_argsr   r   r   
cache_sizer   r   printr   	streaminginfer_streamr   inferoutput)parserargsttsstream r+   ?/home/ubuntu/.local/lib/python3.10/site-packages/soprano/cli.pymain	   sN   



r-   __main__)__doc__r   sopranor   soprano.utils.streamingr   r-   __name__r+   r+   r+   r,   <module>   s   '
