Skip to content

ilovecplusplus97/xi-speech-synthesizer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Add task_ogg

Return voice recording in an .OGG container encoded with OPUS.


习近平讲话模拟器 Xi Jinping Speech Synthesizer

深受 韓國瑜發大財產生器Trumped 启发,特此创作。

本 API 用于合成习近平讲话音频。发送一段文字(简体,繁体,带数字拼音皆可),即可合成非常“真实”的习近平讲话音频。

注意事项

本项目仅供娱乐!请勿用于非法用途!

本人对圣上没有意见,亦无任何政治诉求。请勿过度解读!

使用本项目有巨大风险!后果自负!后果自负!后果自负!

实际上那些错误执行者,他也是有一本账的,这个账是记在那儿的。一旦他出事了,这个账全给你拉出来了。别看你今天闹得欢,小心今后拉清单,这都得应验的。不要干这种事情。头上三尺有神明,一定要有敬畏之心。

互联网并非法外之地

使用方法

创建任务

POST https://xi-speech-synthesizer.herokuapp.com/task

Body

{
	"text":"请输入的文字(1000字以内)。支持简体、繁體 ji2 dai4 sheng1 diao4 pin1 yin1."
}

Response

{
    "id": "55892d29-cec6-495f-b2b3-3139534efaac",
    "request_successful": true
}

查询进度

GET https://xi-speech-synthesizer.herokuapp.com/progress?id=55892d29-cec6-495f-b2b3-3139534efaac

Response (查询成功)

{
    "request_successful": true,
    "result": {
        "finished": true,
        "progress": 1.0
    }
}

Response (查询失败)

{
    "message": "找不到此项目",
    "request_successful": false
}

获取音频

GET https://xi-speech-synthesizer.herokuapp.com/result?id=55892d29-cec6-495f-b2b3-3139534efaac

返回的音频文件经过base64编码,方便嵌入网页前端

Response (获取成功)

{
    "request_successful": true,
    "result": {
        "audio": "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA/+OgwAAAAAAAAAAAAEluZm8AAAAPAAAAAwAAB1cAjo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6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LjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ==",
        "message": [
            "找不到音节 biang",
            "找不到音节 duang",
            "找不到音节 biu"
        ],
        "synthesis_successful": true
    }
}

Response (获取失败)

{
    "message": "找不到此项目",
    "request_successful": false
}

删除数据

DELETE https://xi-speech-synthesizer.herokuapp.com/result?id=55892d29-cec6-495f-b2b3-3139534efaac

Response 1

{
    "request_successful": true
}

Response 2

{
    "message": "项目已被删除",
    "request_successful": false
}

注意:临时存放在服务器上的音频数据会定时清除。

亲自部署

请确保 Python 版本在 3.6 以上。

  1. 创建并进入虚拟环境

  2. 安装 requirements.txt 依赖

    $ pip3 install -r requirements.txt
  3. 安装 ffmpeg (用于编码 mp3 文件)

  4. 运行 Flask APP

    $ export FLASK_APP=api.py
    $ flask run
    * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

    Windows 系统下请运行如下命令:

    set FLASK_APP = api.py
    flask run

后话

本人才疏学浅,在本 API 设计上难免有诸多瑕疵和不规范的地方。欢迎各位开 Issue 提供宝贵建议。本人也会认真阅读及采纳 Pull Request。

感谢 YouTube 频道”乳透社“ 提供的音源

最后,祝你在奔赴刑场的道路上越走越远!🐻

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.9%
  • Procfile 0.1%