modelscopeTTS Unofficial api,see https://github.com/avilliai/modelscopeTTS for more information
Project description
modelscope unofficial api
从pip安装
pip install modelscope_tts
安装此依赖
运行
你可以运行下面这段代码
import asyncio
import modelscope_tts
Cookie=None #大部分speaker不需要cookie,直接用None即可
ms=modelscope_tts.TTS(Cookie) #创建对象
print(ms.listSpeakers()) #查看所有可用的角色
#异步处理方式
asyncio.run(ms.tts(text="你好",speaker="宫子(泳装)") )
#(如果使用["BT","塔菲","阿梓","otto","丁真","星瞳","东雪莲","嘉然","孙笑川","亚托克斯","文静","鹿鸣","奶绿","七海","恬豆","科比"]需要获取cookie
import asyncio
import modelscope_tts
Cookie="你的Cookie" #设置cookie,参照[Manyana#issue7](https://github.com/avilliai/Manyana/issues/7) 复制你的cookie
ms=modelscope_tts.TTS(Cookie) #创建对象
print(ms.listSpeakers()) #查看所有可用的角色
#异步处理方式
asyncio.run(ms.tts(text="你好",speaker="阿梓") )
在异步函数中使用
import asyncio
import modelscope_tts
async def voiceGenerater():
ms=modelscope_tts.TTS(None) #前面我们说了,除了特定speaker需要cookie,其他的直接给TTS传None就行
await ms.tts(text="你好",speaker="宫子(泳装)") #返回的是文件路径,当然,你也可以传递path参数
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
modelscope_tts-0.1.5.tar.gz
(29.7 kB
view details)
Built Distribution
File details
Details for the file modelscope_tts-0.1.5.tar.gz
.
File metadata
- Download URL: modelscope_tts-0.1.5.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 | 46240cbc740388e5256e7bdb01e7143159768706403960d2664a5d2b538ca20c |
|
MD5 | 542b7ff3c64787026b91a71da24cba7c |
|
BLAKE2b-256 | 695173804e1d82e67266243d99e533c6306f5f2cfc46f6574145bd1a8b5227b7 |
File details
Details for the file modelscope_tts-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: modelscope_tts-0.1.5-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 | 6967cf11ec02636fd4a0be6a11e515f513570edc35a2555ab2d145f3c78f7efa |
|
MD5 | a857624ca9492a3b37ac6cdfd751e3f1 |
|
BLAKE2b-256 | da5c67c9bf1643ec7c22247221d2b77bba88fff2838b77de4394601b2017ce5c |