Private
Public Access
1
0

v を更新

2026-01-03 16:30:20 +00:00
parent 3af91bf6c0
commit 28665d8769

125
v.md

@@ -1,61 +1,80 @@
# v # Vmode
ai.v project This activates a special mode that allows you to move your character freely via OSC/VMC protocols.
It enables AI-driven character control. By combining this with external AI tools, you can have conversations with autonomous, unique characters and incorporate them into your livestreams.
## voice ## example
### neuro-sama ### osc
Azure TTS (Ashley voice) + pitch shift +25%
### VOICEVOX
- https://github.com/VOICEVOX/voicevox_engine
```json
{
"speaker": 0,
"speedScale": 1.0,
"pitchScale": 0.07,
"intonationScale": 1.0,
"volumeScale": 1.0,
"prePhonemeLength": 0.1,
"postPhonemeLength": 0.1,
"pauseLengthScale": 1.0,
"outputSamplingRate": 24000,
"outputStereo": false
}
```
自然ではないので、これでは難しい。通常はこのような構成らしい。
> [Style-Bert-VITS2] → 音声 → [リップシンク] → [3Dモデル表示]
### elevenlabs
- https://elevenlabs.io
### gcloud text speech
- https://console.cloud.google.com/apis/api/texttospeech.googleapis.com
```sh ```sh
curl -s -X POST "https://texttospeech.googleapis.com/v1/text:synthesize" \ # pacman -S cargo
-H "Authorization: Bearer ${ACCESS_TOKEN}" \ $ mkdir -p ./tmp
-H "Content-Type: application/json" \ $ cd ./tmp
-d "{
\"input\": {\"text\": \"${TEXT}\"},
\"voice\": {\"languageCode\": \"${LANG_CODE}\", \"name\": \"${VOICE}\"},
\"audioConfig\": {
\"audioEncoding\": \"MP3\",
\"pitch\": ${PITCH},
\"speakingRate\": ${SPEED}
}
}" | jq -r '.audioContent' | base64 -D > "$TMP_MP3"
afplay "$TMP_MP3"
``` ```
## vmc > Cargo.toml
## ue ```toml:Cargo.toml
[dependencies]
rosc = "0.10"
```
> src/main.rs
```rust:src/main.rs
use rosc::{OscMessage, OscPacket, OscType};
use std::net::UdpSocket;
fn main() {
let socket = UdpSocket::bind("0.0.0.0:0").unwrap();
let target = "127.0.0.1:34540";
// Jump
send_osc(&socket, target, "/player/jump", vec![]);
}
fn send_osc(socket: &UdpSocket, target: &str, addr: &str, args: Vec<OscType>) {
let msg = OscMessage { addr: addr.into(), args };
let buf = rosc::encoder::encode(&OscPacket::Message(msg)).unwrap();
socket.send_to(&buf, target).unwrap();
}
```
```sh
$ cargo build
$ ./target/debug/
```
### vmc
```rust:src/main.rs
use rosc::{OscMessage, OscPacket, OscType};
use std::net::UdpSocket;
use std::thread::sleep;
use std::time::Duration;
fn main() {
let socket = UdpSocket::bind("0.0.0.0:0").unwrap();
let target = "127.0.0.1:39539";
// Blink
for value in [0.0, 0.5, 1.0, 0.5, 0.0] {
send(&socket, target, "Blink", value);
sleep(Duration::from_millis(40));
}
}
fn send(socket: &UdpSocket, target: &str, name: &str, value: f32) {
let msg = OscMessage {
addr: "/VMC/Ext/Blend/Val".into(),
args: vec![OscType::String(name.into()), OscType::Float(value)],
};
let buf = rosc::encoder::encode(&OscPacket::Message(msg)).unwrap();
socket.send_to(&buf, target).unwrap();
// Apply
let apply = OscMessage { addr: "/VMC/Ext/Blend/Apply".into(), args: vec![] };
let buf = rosc::encoder::encode(&OscPacket::Message(apply)).unwrap();
socket.send_to(&buf, target).unwrap();
}
```