Code Monkey home page Code Monkey logo

capcut-tts's Introduction

What is this

CapCut の読み上げAPIのセルフホストRapperAPIです

NEWS

2024/05/29

tokenが取得できないバグが修正されました!

2024/05/27

新しい方法の糸口が見えた!!もうしばらくしたら修正アップデートします!!

2024/02/07

2024/02/07 時点でAPIのバージョンが変わり新規に取得した SIGN 及び DEVICE_TIME を利用したtokenの生成ができなくなりました。
現在新しくtokenを取得する方法を準備中です。

How To Use

.envファイルの作成

.env.exampleファイルからコピーして.envファイルを作成し、その中に以下の項目があるかを確認してください。

DEVICE_TIME=""
SIGN=""

それぞれの項目に以下の手順で取得した値を入力してください。

値の入手

1

CapCutへログイン後、新規プロジェクトを空で作成し適当なテキストを作成します。

その後、テキスト読み上げタブへ移り、DevToolsのClear Network logをクリックして一度ログを消して見やすくします。

2

その後、適当な声を選択して生成させましょう。

すると、いくつかの通信が行われログが出てきます。

最初の2000ms程度をフィルタして見てみると画像のような通信ログがあるはずです。(もし数が多い場合は、Filterからtokenと検索してください。)

その中からPOSTで通信しているtokenを見つけてください。

その通信のリクエストヘッダーから画像の二つの値、Device-TimeSignをコピーして先ほど作成した.envファイルの各変数へ記入します。

API Docs

ベースURL

http://<host>:<port>/v1/

エンドポイント

synthesize

リクエスト

GET /v1/synthesize

クリエパラメーター

パラメーター 必須 説明 デフォルト値
text string はい 読み上げるテキスト -
type number いいえ 使用する合成音声のタイプ 0
pitch number いいえ 合成された音声のピッチ 10
speed number いいえ 合成された音声のスピード 10
volume number いいえ 合成された音声のボリューム 10
method string いいえ 合成された音声のレスポンスに使用するメソッド
buffer または stream のいずれか
buffer

レスポンス

ステータスコード 状態 説明 内容
200 OK 成功 WAV形式の合成された音声を返します buffer メソッドの場合: 完全なバッファとして音声を返します
stream メソッドの場合: 音声データをストリーム配信します
400 Bad Request エラー クエリパラメータが不足しています json { "error": "Bad Request" }
500 Internal Server Error エラー 音声生成に問題が発生しました buffer メソッドの場合: json { "error": "can't get buffer" }
stream メソッドの場合: json { "error": "can't get stream" }

リクエスト例

GET http://localhost:8080/v1/synthesize?text=こんにちは&type=0&pitch=10&speed=10&volume=10&method=buffer

レスポンス例

ステータスコード Content-Type 内容
200 OK audio/wav WAV形式の音声バッファ

Voice Type List

type 声の種類 スピーカーID
0 謎1 男子1 BV525_streaming
1 謎2 坊や BV528_streaming
2 カワボ BV017_streaming
3 お姉さん BV016_streaming
4 少女 BV023_streaming
5 女子 BV024_streaming
6 男子2 BV018_streaming
7 坊ちゃん BV523_streaming
8 女子 BV521_streaming
9 女子アナ BV522_streaming
10 男性アナ BV524_streaming
11 元気ロリ BV520_streaming
12 明るいハニー VOV401_bytesing3_kangkangwuqu
13 優しいレディー VOV402_bytesing3_oh
14 風雅メゾソプラノ VOV402_bytesing3_aidelizan
15 Sakura jp_005
その他/入力なし お姉さん BV016_streaming

capcut-tts's People

Contributors

kuwacom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

capcut-tts's Issues

How to get more Voice Type List?

First I thank you for this wonderful application.
I want to ask you about how to get voice list type for languages ​​other than Japanese?
Thank you very much!

ENV Key

Can you help me with the CapCut TTS rapper API ENV key by showing examples?

Tokenを発行できない

Describe the bug
今現在、サイトから取得したSIGNDEVICE_TIMEを利用してもトークンを取得することができない。

To Reproduce
新規に作成したSIGNDEVICE_TIMEを使用する

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.