From 28665d876928ae60c9128073ee290ca41837a30b Mon Sep 17 00:00:00 2001 From: syui Date: Sat, 3 Jan 2026 16:30:20 +0000 Subject: [PATCH] =?UTF-8?q?v=20=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v.md | 113 ++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 66 insertions(+), 47 deletions(-) diff --git a/v.md b/v.md index 281660f..1f8a0b9 100644 --- a/v.md +++ b/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% +```sh +# pacman -S cargo +$ mkdir -p ./tmp +$ cd ./tmp +``` -### VOICEVOX +> Cargo.toml -- https://github.com/VOICEVOX/voicevox_engine +```toml:Cargo.toml +[dependencies] +rosc = "0.10" +``` -```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 +> 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) { + let msg = OscMessage { addr: addr.into(), args }; + let buf = rosc::encoder::encode(&OscPacket::Message(msg)).unwrap(); + socket.send_to(&buf, target).unwrap(); } ``` -自然ではないので、これでは難しい。通常はこのような構成らしい。 - -> [Style-Bert-VITS2] → 音声 → [リップシンク] → [3Dモデル表示] - -### elevenlabs - -- https://elevenlabs.io - -### gcloud text speech - -- https://console.cloud.google.com/apis/api/texttospeech.googleapis.com - ```sh -curl -s -X POST "https://texttospeech.googleapis.com/v1/text:synthesize" \ - -H "Authorization: Bearer ${ACCESS_TOKEN}" \ - -H "Content-Type: application/json" \ - -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" +$ cargo build +$ ./target/debug/ ``` -## vmc +### vmc -## ue \ No newline at end of file +```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(); +} +``` \ No newline at end of file