??Chinese | English | Documents/Docs | ?Models/Models


Parrots, Automatic Speech Recognition( ASR ), Text-To-Speech( TTS ) toolkit, support Chinese, English, Japanese, etc.
parrots implements one-click call to speech recognition and speech synthesis models, which are out of the box and support Chinese and English.
distilwhisper , supports multiple languages such as Chinese and English.GPT-SoVITS training, supports Chinese, English, Japanese and other languages pip install torch # or conda install pytorch
pip install -r requirements.txt
pip install parrotsor
pip install torch # or conda install pytorch
git clone https://github.com/shibing624/parrots.git
cd parrots
python setup.py install
run example: examples/tts_gradio_demo.py to see the demo:
python examples/tts_gradio_demo.pyexample: examples/demo_asr.py
import os
import sys
sys . path . append ( '..' )
from parrots import SpeechRecognition
pwd_path = os . path . abspath ( os . path . dirname ( __file__ ))
if __name__ == '__main__' :
m = SpeechRecognition ()
r = m . recognize_speech_from_file ( os . path . join ( pwd_path , 'tushuguan.wav' ))
print ( '[提示] 语音识别结果:' , r )output:
{'text': '北京图书馆'}
example: examples/demo_tts.py
import sys
sys . path . append ( '..' )
import parrots
from parrots . tts import TextToSpeech
parrots_path = parrots . __path__ [ 0 ]
sys . path . append ( parrots_path )
m = TextToSpeech (
speaker_model_path = "shibing624/parrots-gpt-sovits-speaker-maimai" ,
speaker_name = "MaiMai" ,
)
m . predict (
text = "你好,欢迎来北京。welcome to the city." ,
text_language = "auto" ,
output_path = "output_audio.wav"
)output:
Save audio to output_audio.wav
Support execution of ARS and TTS tasks through command line, code: cli.py
> parrots -h
NAME
parrots
SYNOPSIS
parrots COMMAND
COMMANDS
COMMAND is one of the following:
asr
Entry point of asr, recognize speech from file
tts
Entry point of tts, generate speech audio from text
run:
pip install parrots -U
# asr example
parrots asr -h
parrots asr examples/tushuguan.wav
# tts example
parrots tts -h
parrots tts "你好,欢迎来北京。welcome to the city. " output_audio.wavasr and tts are secondary commands, asr is speech recognition, tts is speech synthesis, and the default model is Chinese modelparrots asr -h for the usage of each secondary commandexamples/tushuguan.wav is the audio_file_path parameter of asr method, and the input audio file (required) | speaker name | Name of the speaker | character | Characteristics | language | language |
|---|---|---|---|---|---|
| KuileBlanc | Kwai LeBron | lady | Standard American female voice | en | Britain |
| LongShouRen | Long Shouren | gentleman | Standard American male voice | en | Britain |
| MaiMai | Sell and sell | sing female anchor | Singing female anchor voice | zh | middle |
| XingTong | Star Eye | sing air girl | Lively female voice | zh | middle |
| XuanShen | Show off God | game male anchor | The voice of the male anchor of the game | zh | middle |
| KusanagiNene | Kusanagi Ning | loli | Loli female student voice | ja | day |
| speaker name | Name of the speaker | character | Characteristics | language | language |
|---|---|---|---|---|---|
| MaiMai | Sell and sell | sing female anchor | Singing female anchor voice | zh | middle |

If you use parrots in your research, please quote it in the following format:
@misc{parrots,
title={parrots: ASR and TTS Tool},
author={Ming Xu},
year={2024},
howpublished={ url {https://github.com/shibing624/parrots}},
}The license agreement is The Apache License 2.0, which can be used for commercial purposes for free. Please attach the parrots link and authorization agreement to the product description.
The project code is still very rough. If you have improved the code, you are welcome to submit it back to this project. Before submitting, pay attention to the following two points:
testspython -m pytest to run all unit tests to ensure that all single tests are passedYou can submit your PR later.