Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ollama voicevox 3jsでAIアバターを喋らせる
Search
ymn
September 23, 2025
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ollama voicevox 3jsでAIアバターを喋らせる
ymn
September 23, 2025
More Decks by ymn
See All by ymn
ElixirでローカルLLM+Difyを動かし、MCPが混ざると ….
ymn
0
93
piyopiyo.ex #1 Phoenix install 〜Hello,world! (Windows)
ymn
0
460
Featured
See All Featured
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
400
Raft: Consensus for Rubyists
vanstee
141
7.6k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.6k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
180
First, design no harm
axbom
PRO
2
1.2k
Music & Morning Musume
bryan
47
7.2k
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
It's Worth the Effort
3n
188
29k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
760
Transcript
ollama + voicevox + 3jsでAI アバターを喋らせる
自己紹介 • YMN (45) • フリーランスです • Elixir歴 5年ぐらい •
2年前にくも膜下出血で脳を手術してます (前世は2023/9/27まで) ◦ 後遺症で失語症があります ▪ その為発音が変です • 主に関わったElixirのPJ ◦ Bright (スキルを可視化) https://app.bright-fun.org ▪ グラフ描画全般 ◦ CodeLingo (AIを使った教材作成)https://app.codelingo.tech ▪ インフラ(Azure)とAI連携のライブラリー作成
None
構成(詳し内容は次ページから) 今回の本体 Elixir AI Ollama テキスト読み上げ Voicevox 音声再生コマンド aplay ブラウザ
3D表示(3js) 文字入 力 ① ② ③ ④ これを作った当時はUbuntu 24.04
Ollamaとは • 無料で使えるAIです • ローカルでも動きます • モデルが軽ければ、CPUのみでも動作が可能です • もちろんGPUで動かした方が高速で動作します https://ollama.com/
ElixirからOllamaを使うには • Ollamaというライブラリーを使います • 実際にライブラリーのページで確認します https://hexdocs.pm/ollama/Ollama.html
今回使ったAIモデル • AIモデルとは AIモデルは、コンピューターがたくさんのデータからルールやパターンを学び、それを使って新しい問題に答えたり、何かを予測したりする • gemma3:1b-it-qat ◦ Googleが作ったモデルです ◦ 1.1億パラメータ
▪ この数値が大きいと賢いです ◦ 量子化 ▪ 軽量で動作が軽いです、結果の精度は犠牲にしてます ▪ モデルによってはCPUでも動きます https://ollama.com/library/gemma3
Voicevoxとは • 無料で使える中品質なテキスト読み上げ・歌声合成ソフト ウェア • 実際にVoicevoxページで確認します https://voicevox.hiroshiba.jp/
VoicevoxをElixirで使うには • VoicevoxのAPIを叩くだけです ◦ audio_queryで音声合成用のクエリを作成する ◦ synthesis音声合成する ◦ 上記をReqでAPIをhttp postで呼ぶ
◦ 音声をOS付属のコマンドaplayで再生 ▪ 本来はブラウザーで直接再生できます https://voicevox.github.io/voicevox_engine/api/ https://hexdocs.pm/req/readme.html
three.jsとは • JSでブラウザーを使って3Dを描画できます ◦ シーン(Scene) ▪ 撮影セットになります、その中には • 3Dモデルを設置 ◦
今回はアバターを表示されてます ◦ アバターはVroidStudio ◦ VRM形式を使用する • カメラを設置 • 照明を設置 https://threejs.org/manual/#ja/fundamentals https://vroid.com/studio
Elixirでthree.jsを使うには • 力技で頑張る ◦ hookを使う ◦ ライブラリーを自作する 以上 今回はAI会なので詳細は省略 時間があったらソースコードを元に説明 DevelopGameXコミニティーの会で触れることがあります
https://dgx.connpass.com/
実際にソースを見ましょう ソース • Git ◦ https://github.com/ymn-t-yamanashi/eli • メインロジック ◦ https://github.com/ymn-t-yamanashi/eli/blob/main/lib/eli_web/live/eli.ex
• Voicevox ◦ https://github.com/ymn-t-yamanashi/eli/blob/main/lib/speak.ex • 3jsオレオレライブラリー ◦ https://github.com/ymn-t-yamanashi/eli/blob/main/lib/eli_web/live/cg_helper.ex ◦ https://github.com/ymn-t-yamanashi/eli/blob/main/assets/js/three.js サンプル動画 https://www.youtube.com/watch?v=A50WzTWCLok 終わり