modelscopeTTS Unofficial api,see https://github.com/avilliai/modelscopeTTS for more information
Project description
modelscope unofficial api
从pip安装
pip install Enkianthus_tts
安装此依赖
运行
你可以运行下面这段代码
import asyncio
import Enkianthus_tts
Cookie=None #大部分speaker不需要cookie,直接用None即可
ms=Enkianthus_tts.TTS(Cookie) #创建对象
print(ms.listSpeakers()) #查看所有可用的角色
#异步处理方式
asyncio.run(ms.tts(text="你好",speaker="宫子(泳装)") )
#(如果使用["BT","塔菲","阿梓","otto","丁真","星瞳","东雪莲","嘉然","孙笑川","亚托克斯","文静","鹿鸣","奶绿","七海","恬豆","科比"]需要获取cookie
import asyncio
import Enkianthus_tts
Cookie="你的Cookie" #设置cookie,参照[Manyana#issue7](https://github.com/avilliai/Manyana/issues/7) 复制你的cookie
ms=Enkianthus_tts.TTS(Cookie) #创建对象
print(ms.listSpeakers()) #查看所有可用的角色
#异步处理方式
asyncio.run(ms.tts(text="你好",speaker="阿梓") )
在异步函数中使用
import asyncio
import Enkianthus_tts
async def voiceGenerater():
ms = Enkianthus_tts.TTS(None) # 前面我们说了,除了特定speaker需要cookie,其他的直接给TTS传None就行
await ms.tts(text="你好", speaker="宫子(泳装)") # 返回的是文件路径,当然,你也可以传递path参数
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Enkianthus_tts-0.1.7.tar.gz
(29.7 kB
view details)
Built Distribution
File details
Details for the file Enkianthus_tts-0.1.7.tar.gz
.
File metadata
- Download URL: Enkianthus_tts-0.1.7.tar.gz
- Upload date:
- Size: 29.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0023d61c764b21e01259f1a9938be3a4426a09f17c43afb361efa564370f1743 |
|
MD5 | 2969b4324306a3d23cf35428f255f5c4 |
|
BLAKE2b-256 | 9a237c2bd005b8a910b14eaa8299868a3a831b9dca24fdabc5f615c1a151f875 |
File details
Details for the file Enkianthus_tts-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: Enkianthus_tts-0.1.7-py3-none-any.whl
- Upload date:
- Size: 29.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 098bee60bff288e8d71b33e3c1e714aec17e5e9f3cdd76cc46bb83764e3f4876 |
|
MD5 | 7d5bca54aec45e72df3defd8e251b87c |
|
BLAKE2b-256 | 9027db63f9834fcad3b9d26a76f50bad01041ddb798064891f0ccc396639783b |