Spaces:
Sleeping
Sleeping
add images
Browse filesFiles changed (8)
- README.md+69-2
- app.py+82-18
- imgs/0.webpAdded
- imgs/1.webpAdded
- imgs/2.webpAdded
- imgs/3.webpAdded
- imgs/4.webpAdded
- imgs/5.webpAdded
7 unmodified lines8910111213147 unmodified linesapp_file: app.pypinned: falselicense: mitshort_description: TTS voice for AI (Creently Matcha-TTS)---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference7 unmodified lines891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980817 unmodified linesapp_file: app.pypinned: falselicense: mitshort_description: TTS voice for AI (Currently Matcha-TTS)---# AIGamingVoice - Japanese / 日本語High-quality, lightweight Japanese Text-to-Speech specifically tuned for AI gaming characters.Running on ONNX Runtime for fast inferenceAIゲームキャラクター向けに調整された高品質・軽量な日本語音声合成システムです。ONNX Runtime上で動作します。## 🌟 Features / 特徴- **⚡ Fast & Lightweight**: Pure ONNX Runtime implementation- **高速・軽量**: 純粋なONNX Runtime実装です。- **🖼️ Visual Speaker Selection**: Select speakers intuitively from an image gallery.- **視覚的な話者選択**: 画像ギャラリーから直感的にキャラクター(話者)を選択できます。- **🇯🇵 Japanese Optimization**: Uses `pyopenjtalk` for accurate Japanese phoneme generation.- **日本語最適化**: `pyopenjtalk` を使用し、正確な日本語読み上げを実現しています。## 🛠️ Installation & Local Usage / インストールとローカルでの使用方法1. **Clone the repository / リポジトリをクローン**```bashgit clone https://huggingface.co/spaces/YOUR_USERNAME/AIGamingVoice-Japanesecd AIGamingVoice-Japanese```2. **Install dependencies / 依存関係のインストール**```bashpip install -r requirements.txt```*Note: You need `cmake` installed for pyopenjtalk.**注: pyopenjtalkのインストールには `cmake` が必要です。*3. **Prepare Models / モデルの準備**Place your `.onnx` models in the `models/` directory.`models/` ディレクトリに `.onnx` モデルファイルを配置してください。4. **Prepare Speaker Images (Optional) / 話者画像の準備(オプション)**Place images (`0.jpg`, `1.jpg`, ...) in the `imgs/` directory to enable the visual selector.`imgs/` ディレクトリに画像ファイル(`0.jpg`, `1.jpg` ...)を配置すると、画像による話者選択機能が有効になります。5. **Run the application / アプリケーションの実行**```bashpython app.py```Access http://localhost:7860 in your browser.ブラウザで http://localhost:7860 にアクセスしてください。## 🎮 How to Use / 使い方1. **Select Model**: Choose a voice model from the dropdown.- **モデル選択**: ドロップダウンから音声モデルを選択します。2. **Select Speaker**: Click on a character image or enter the Speaker ID.- **話者選択**: キャラクター画像をクリックするか、Speaker IDを入力します。3. **Input Text**: Enter Japanese text to synthesize.- **テキスト入力**: 読み上げたい日本語テキストを入力します。4. **Adjust Settings**: Tweak Temperature (randomness) and Speaking Rate (speed).- **設定調整**: Temperature(ランダム性)やSpeaking Rate(話速)を調整できます。5. **Synthesize**: Click the button to generate audio.- **音声生成**: ボタンをクリックして音声を生成します。## 🤝 Credits / クレジット- **Matcha-TTS**: Architecture based on Matcha-TTS.- **ONNX Runtime**: Inference engine.- **pyopenjtalk**: Japanese text processing frontend.---*Created for AI Gaming Voice Project*
318 unmodified lines31932032132232332432532632732832933033133214 unmodified lines3473483493503513521 unmodified line35435535635735835936042 unmodified lines4034044054064074084094104114124134144154164178 unmodified lines42642742842943043143243343443543643743843944044144244310 unmodified lines454455456457318 unmodified lines# Get available modelsavailable_models = get_available_models()with gr.Blocks(title="🍵 Matcha-TTS ONNX (Japanese)",) as demo:gr.Markdown("""# 🍵 Matcha-TTS ONNX - Japanese Text-to-Speech### PyTorch-free implementation using ONNX Runtime""")14 unmodified linesplaceholder="日本語のテキストを入力してください...")# Speaker IDspeaker_id = gr.Number(label="Speaker ID (スピーカーID)",1 unmodified lineminimum=0,maximum=99,precision=0,info="単一スピーカーモデルでは無視されます")with gr.Row():42 unmodified linesgr.Examples(examples=[["こんにちは、世界!", "g003_ep5709.onnx", 0, 0.667, 1.0],["本日は晴天なり。", "g003_ep5709.onnx", 0, 0.667, 1.0],["日本語の音声合成をテストしています。", "g003_ep5709.onnx", 0, 0.667, 1.0],["人工知能の進化は目覚ましいものがあります。", "g003_ep5709.onnx", 0, 0.667, 1.0],],inputs=[text_input, model_dropdown, speaker_id, temperature, speaking_rate],label="例文 / Examples")# Event handlerssynthesise_btn.click(fn=synthesise,inputs=[text_input, model_dropdown, speaker_id, temperature, speaking_rate],8 unmodified linesgr.Markdown("""---### 情報 / Information- **モデル**: ONNX (PyTorch-free)- **サンプルレート**: 22050 Hz- **音素化**: pyopenjtalk- **推論**: ONNX Runtime- **モデル自動切り替え**: 選択したモデルを自動的にロード### Speaker ID について- **単一スピーカーモデル**: Speaker ID は無視されます- **マルチスピーカーモデル**: Speaker ID で話者を切り替え""")return demo10 unmodified linesserver_port=7860,share=False,show_error=True)318 unmodified lines31932032132232332432532632732832933033133233333433533633733833934034134234314 unmodified lines3583593603613623633643653663673683693703713723733743753763773783791 unmodified line38138238338438538638742 unmodified lines4304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634648 unmodified lines47347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650710 unmodified lines518519520521318 unmodified lines# Get available modelsavailable_models = get_available_models()# Load speaker imagesimgs_dir = os.path.join(SCRIPT_DIR, "imgs")speaker_images = []if os.path.exists(imgs_dir):# Sort by numerical filename (0.webp, 1.webp, ...)image_files = sorted(glob.glob(os.path.join(imgs_dir, "*.webp")),key=lambda x: int(os.path.splitext(os.path.basename(x))[0]))speaker_images = [(img, f"Speaker {os.path.splitext(os.path.basename(img))[0]}") for img in image_files]with gr.Blocks(title="AI Gaming Voice",) as demo:gr.Markdown("""# AI Gaming Voice - 🍵 Matcha-TTS ONNX (Japanese) / 日本語### 6 Voices - 140MB or 42MB(Qint8 but slow)Japanese Text-to-Speech.(Half-width alphanumeric characters are not supported. Please correct/fix it.)日本語音声合成です。(半角・英数字は未対応・直してください。)""")14 unmodified linesplaceholder="日本語のテキストを入力してください...")# Speaker Selection Galleryif speaker_images:gr.Markdown("### 話者選択 / Select Speaker")speaker_gallery = gr.Gallery(value=speaker_images,label="話者 / Speakers",show_label=False,columns=6,rows=1,height=160,allow_preview=False,interactive=False,object_fit="cover",elem_id="speaker_gallery")# Speaker IDspeaker_id = gr.Number(label="Speaker ID (スピーカーID)",1 unmodified lineminimum=0,maximum=99,precision=0,info="上の画像をタップするか、数値を入力してください")with gr.Row():42 unmodified linesgr.Examples(examples=[["こんにちは、世界!", "g003_ep5709.onnx", 0, 0.667, 1.0],["エイアイゲーミングボイス", "g003_ep5709.onnx", 0, 0.667, 0.8],["わたくしの名前はストラよ", "g003_ep5709.onnx", 0, 0.667, 1.0],["わたしの名前はシムですよ", "g003_ep5709.onnx", 1, 0.667, 1.0],["わたしはナラともうします", "g003_ep5709.onnx", 2, 0.667, 1.0],["わたし、ロールプリンよ!", "g003_ep5709.onnx", 3, 0.667, 1.0],["僕の名前はショーンだよ", "g003_ep5709.onnx", 4, 0.667, 1.0],["私の名前はありません", "g003_ep5709.onnx", 5, 0.667, 1.0],],inputs=[text_input, model_dropdown, speaker_id, temperature, speaking_rate],label="例文 / Examples")# Event handlers# Gallery click handlerif speaker_images:def on_gallery_select(evt: gr.SelectData):return evt.indexspeaker_gallery.select(fn=on_gallery_select,inputs=None,outputs=speaker_id).then(fn=synthesise,inputs=[text_input, model_dropdown, speaker_id, temperature, speaking_rate],outputs=[audio_output, info_output])synthesise_btn.click(fn=synthesise,inputs=[text_input, model_dropdown, speaker_id, temperature, speaking_rate],8 unmodified linesgr.Markdown("""---### ℹ️ Information / 情報- **Model / モデル**: Matcha-TTS (ONNX)- **Inference / 推論**: ONNX Runtime- **Phonemizer / 音素化**: `pyopenjtalk`- **ZeroGPU**: Optimized for fast startup & inference / 高速起動・推論に最適化### 🗣️ Speaker Selection / 話者選択- **Click Image / 画像クリック**: Selects speaker & generates audio / 話者を選択して音声を生成- **Speaker ID**: Manual input also supported / 手動入力も可能### FAQ**Why AI Gaming Voice?**- I have a plan to support another ONNX models.**Model Difference**- **qint8**: 1/3 size but slow.**How to create my voice**- [Github](https://github.com/akjava/Matcha-TTS-Japanese) - I'll update here.**Model**- [Huggingface:matcha-tts_ja_100speakers_group003f-CL-V2](https://huggingface.co/Akjava/matcha-tts_ja_100speakers_group003f-CL-V2)**Who are they?**- [Youtube:4 of them are member of AI Gaming Circle](https://www.youtube.com/@ai-gaming-circle)""")return demo10 unmodified linesserver_port=7860,share=False,show_error=True)
README.md+69-2
app.py+82-18
imgs/0.webpAdded

imgs/1.webpAdded

imgs/2.webpAdded

imgs/3.webpAdded

imgs/4.webpAdded

imgs/5.webpAdded
