ã¯ããã«
æ¨å¹´ã« Unity ä¸ã§ãªã¢ã«ã¿ã¤ã ã«ãªããã·ã³ã¯ãè¡ã uLipSync ã¨ãããã®ããªãªã¼ã¹ãã¾ããã
AudioClip
ã®å
¥åã Job System 㨠Burst ã³ã³ãã¤ã©ãå©ç¨ãã¦ãªã¢ã«ã¿ã¤ã ã«è§£æã㦠MFCC ã¨å¼ã°ããç¹å¾´éãæ½åºããäºããã£ãªãã¬ã¼ã·ã§ã³ãã¦ä½æãã¦ããããããã¡ã¤ã«ã¨ç
§ããåããã¦ä¸çªè¿ãé³ç´ ãæ¨å®ãããããã¬ã³ãã·ã§ã¤ãã¸ã¨åæ ããããã¨ããä»çµã¿ã®ãã®ã§ããããã ããã¤ã¯å
¥åãªã©ããã®å ´ã§æ¯åç°ãªãé³å£°æ³¢å½¢ãä¸ããããå ´åã¯è¯ãã®ã§ãããæãã«ããã·ã¼ã³ã®ãããªäºã決ã¾ã£ãé³æºãããã±ã¼ã¹ã«ããã¦ã¯ãªã¢ã«ã¿ã¤ã ã«è¨ç®ããå¿
è¦ã¯ãªããçµæãäºåã«ç¢ºèªã§ããã¨ããå©ç¹ã®ä¸ã§ãå¦çè² è·åæ¸ã®é¢ã§ããäºãè¨ç®ãã¦ãããã¨ä¾¿å©ã§ãã
ããã§ãä»åæ°ããäºåè¨ç®ãè¡ãä»çµã¿ãå°å ¥ããã¾ãã¿ã¤ã ã©ã¤ã³ã®å¯¾å¿ãè¡ãã¾ãããä½µãã¦ã³ã¼ãã UIããã£ãªãã¬ã¼ã·ã§ã³æ¯æ´ã³ã³ãã¼ãã³ãã®è¿½å ããµã³ãã«ã®è¿½å ä¿®æ£ï¼VRM 対å¿ãªã©ï¼ãè¡ããv2 ã¨ãã¦ãªãªã¼ã¹ãã¾ãããæ¬è¨äºã§ã¯æ°ãããªã£ã uLipSync ã®ä½¿ãæ¹ã®èª¬æãè¡ã£ã¦ããã¾ãã
uLipSync ã®ç¹å¾´
以ä¸ã®ãããªç¹å¾´ãããã¾ãã
- Job System 㨠Burst ã使ããã¤ãã£ããã©ã°ã¤ã³ã¯ä¸ä½¿ç¨ã§ OS ãåããã«é«éåä½å¯è½
- ãã£ãªãã¬ã¼ã·ã§ã³ãããã¨ã§ãã£ã©ã¯ã¿æ¯ã®ãããã¡ã¤ã«ä½æãå¯è½
- ð ã©ã³ã¿ã¤ã 解æãäºåãã¤ã¯å¦çã©ã¡ããå©ç¨å¯è½
- ð äºåãã¤ã¯å¦çã®å ´åãTimeline ã¨ã®é£æºå¯è½
OVRLipSync ãªã©ã¨æ¯ã¹ãã¨è¨å®ãå¤ããªã£ã¦ãã¾ãï¼+ æ±ç¨çãªç²¾åº¦ã¯å£ãï¼ã®ã§ããããã£ãªãã¬ã¼ã·ã§ã³ã«ãã£ã¦èªèããããé³ã調æ´å¯è½ã ã£ããã対å¿ãã©ãããã©ã¼ã ãå¤ãã£ãããTimeline ã¨ã®é£æºãåºæ¥ããã¨ãã£ãç¹ãå·®å¥åãã¤ã³ãã§ãã
以ä¸ãããå°ãé°å²æ°ãæ´ãã§é ããããç»åã¨ä¸ç·ã«åæ©è½ãç´¹ä»ãã¾ãï¼
ãªããã·ã³ã¯
ç»é²ããé³ç´ ã«ä½µãããªããã·ã³ã¯ãåºæ¥ã¾ãã
ãããã¡ã¤ã«ã®è¨å®
ãã£ã©ã¯ã¿æ¯ã«ãããã¡ã¤ã«ãä½æãããã£ãªãã¬ã¼ã·ã§ã³ãããã¨ã§èª¿æ´ãåºæ¥ã¾ãã
ãªã¢ã«ã¿ã¤ã 解æ
AudioSource
ã§åçãããé³å£°æ³¢å½¢ã JobSystem 㨠Burst Compiler ã®æ©æµã§ããããé«éã«ãªã¢ã«ã¿ã¤ã ã§è§£æãããã¬ã³ãã·ã§ã¤ãã¸åæ ãã¾ãã
ãã¤ã¯å ¥å
ãã¤ã¯å ¥åãåæ ããã³ã³ãã¼ãã³ããä»å±ãã¦ãã¾ãã®ã§ãé ä¿¡ç¨éãªã©ã«ã使ããã¨æãã¾ãã
VRM 対å¿
VRM ç¨ã®ãã¬ã³ãã·ã§ã¤ããåããã³ã³ãã¼ãã³ãããµã³ãã«ä¸ã«ä»å±ãã¦ãã¾ãã
äºåè¨ç®
åç´ãª AudioClip
åçåãã«ã¯ãäºåã«è¨ç®ãã¦ãããã¨ãåºæ¥ã¾ããçµæã確èªã§ãã¦èª¿æ´ããããã£ããããã©ã¼ãã³ã¹é¢ã§ã®å©ç¹ãªã©ãããã¾ãã
ã¿ã¤ã ã©ã¤ã³é£æº
ã¾ãäºåè¨ç®ãã¼ã¿ã¨ã®çµã¿åããã§ã¿ã¤ã ã©ã¤ã³é£æºãå¯è½ã§ãã
追è¨ï¼2022/02/19ï¼: ã¢ãã¡ã¼ã·ã§ã³ãã¤ã¯
追è¨ï¼2022/08/31ï¼ï¼ãã¯ã¹ãã£å¤æ´
追è¨ï¼2022/12/28ï¼ï¼Animator
ãã¦ã³ãã¼ã
Package Manager ããã¤ã³ã¹ãã¼ã«ããã㯠.unitypackage ããã¦ã³ãã¼ãã»ããã¸ã§ã¯ãã¸å±éããæ¹æ³ã®ã©ã¡ããã§å°å ¥ã§ãã¾ããPackage Manager ããªã¹ã¹ã¡ãã¾ãããæ £ãã¦ããªã人㯠.unitypackage ãã使ããã ããï¼ãã ãããã®å ´åã Package Manager ä¸ã§å¿ è¦ãªå ¬å¼ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ããå¿ è¦ãããã¾ãï¼ã
Package Manager
å°å ¥ããæ¹æ³ã¯ã©ã¡ããããé¸ã³ãã ãããå人çã«ã¯ãã¼ã¸ã§ã³ç®¡çãåºæ¥ãã®ã§ Scoped Registry ç»é²ãããããã§ããå·çæã®ãã¼ã¸ã§ã³ã¯ v2.0.2 ã«ãªãã¾ã
Scoped Registry
- Project Settings > Package Manager ãã Scoped Registries ã«ä»¥ä¸ãç»é²
- Name:
hecomi
- URL:
https://registry.npmjs.com
- Scope:
com.hecomi
- Name:
- Package Manager ã® Packages: My Registries ãã uLipSync ãã¤ã³ã¹ãã¼ã«
- å¿ è¦ãªãµã³ãã«ã¯ã¤ã³ã¹ãã¼ã«å¾ã®ç»é¢ããé©å®ã¤ã³ã¹ãã¼ã«
Git URL
- Add package from git URL ã§ä»¥ä¸ã® URL ã追å
- å¿ è¦ãªãµã³ãã«ã¯ã¤ã³ã¹ãã¼ã«å¾ã®ç»é¢ããé©å®ã¤ã³ã¹ãã¼ã«
UPM ã«ã¤ãã¦ã®è©³ç´°ã¯ä»¥ä¸ã®è¨äºããåç §ä¸ããï¼
.unitypackage ã®ãã¦ã³ãã¼ã
- ææ°ã®ãã¼ã¸ã§ã³ã Releases ãããã¦ã³ãã¼ããæ¬ä½ã¨å¿ è¦ãªãµã³ãã«ãããã¸ã§ã¯ãã«å±é
- Package Mananager ãã Mathematics ããã³ Burst ãã¤ã³ã¹ãã¼ã«
使ãæ¹ - ã©ã³ã¿ã¤ã 解æç·¨
ä»çµã¿
Unity çµã¿è¾¼ã¿ã® AudioSource ã§é³ãåçãããã¨ãåã GameObject ã«ã¢ã¿ãããããã³ã³ãã¼ãã³ãã® OnAudioFilterRead() ã¨ããã¡ã½ããã«ãã®é³ã®ãããã¡ãå
¥ã£ã¦ãã¾ãããã®ãããã¡ãæ¸ãæãã¦ãªãã¼ãå¦çãæ½ãããã¨ãã£ããã¨ãå¯è½ãªã®ã§ãããä»ã©ããªæ³¢å½¢ãåçããã¦ãããããããã®ã§ãããã解æã㦠ã¡ã«å¨æ³¢æ°ã±ãã¹ãã©ã ä¿æ°ï¼Mel-Frequency Cepstrum CoefficientsãMFCCï¼ã¨ãã人éã®å£°éç¹æ§ã表ãç¹å¾´éãè¨ç®ãã¾ããã¤ã¾ãããã¾ãè¨ç®ããã°åçããã¦ããç¾å¨ã®æ³¢å½¢ãããããªããããã£ã½ããã©ã¡ã¿ããããããªããããã£ã½ããã©ã¡ã¿ãå¾ãããããã§ããï¼æ¯é³ä»¥å¤ã«ãããã¼ãã¿ãããªåé³ãåããã¾ãï¼ããããäºãç»é²ãã¦ããããããããããããããã®ãã©ã¡ã¿ã¨æ¯è¼ããç¾å¨ã®é³ã«ããããã®é³ç´ ãã©ãã ãè¿ãããç®åºãããã SkinnedMeshRenderer
ã®ãã¬ã³ãã·ã§ã¤ãã¸ã¨åæ ãããã°ãªããã·ã³ã¯ãå¯è½ã¨ãªãããã§ãããã¤ã¯ããã®å
¥åã AudioSource ã«æµãè¾¼ãã§ãããã°ãä»åã£ã¦ãã声ã«åããã¦å£ãã¯ãå¯è½ã«ãªãã¾ãã
ãã®è§£æãè¡ãã³ã³ãã¼ãã³ãã uLipSync
ããã®ã³ã³ãã¼ãã³ãã«ã»ããããåé³ç´ ãã©ã¡ã¿ã®ãã¼ã¿ã Profile
ãããã¦ãã¬ã³ãã·ã§ã¤ããåããããã®ã³ã³ãã¼ãã³ãã uLipSyncBlendShape
ã¨ãªãã¾ããã¾ãããã¤ã¯ã®é³å£°ãåçãã uLipSyncMicrophone
ã¢ã»ãããç¨æãã¦ããã¾ããããããå³è§£ããã¨ãããªæãã§ãã
ãªã®ã§ç»å ´äººç©ã¨ãã¦ã¯å¤§ããåãã¦ããã£ãªãã¬ã¼ã·ã§ã³ããããã¼ã¿ããããã¼ã¿ããã¨ã«é³å£°è§£æããã人ããã解æãããçµæã使ã£ã¦ãªã«ããã人ãã® 3 種é¡ãããå½¢ã§ããã§ã¯ãããè¸ã¾ãã¦ã©ã³ã¿ã¤ã 解æãè¡ã£ã¦ãªããã·ã³ã¯ããããããã®æé ã«ã¤ãã¦è¦ã¦ããã¾ãããã
ã»ããã¢ãã
ã¾ãã¯ãã¦ããã£ã¡ããã§ã»ããã¢ãããã¦ã¿ã¾ãããããµã³ãã«ã·ã¼ã³ã¯ Samples / 01. Play AudioClip / 01-1. Play Audio Clip ã«ãªãã¾ããUPM ããã¤ã³ã¹ãã¼ã«ãã人㯠Samples / 00. Common ãµã³ãã«ãã¤ã³ã¹ãã¼ã«ãã¦ããã¦ãã ããï¼ã¦ããã£ã¡ããã®ã¢ã»ãããå«ã¾ãã¦ãã¾ãï¼ã
ã¾ããã¦ããã£ã¡ãããé
ç½®ããå¾ãAudioSource
ã³ã³ãã¼ãã³ããä»»æã®ã²ã¼ã ãªãã¸ã§ã¯ãï¼é³ããªãå ´æï¼ã«è¿½å ããã¯ãªãããè¨å®ãã¦é³ããªãããã«ãã¾ãã
次ã«åãã²ã¼ã ãªãã¸ã§ã¯ãã« uLipSync
ã³ã³ãã¼ãã³ãã追å ãã¾ããããã«Profile
ãæå®ããã®ã§ãããä»ã¯ uLipSync-Profile-UnityChan ããªã¹ãããé¸æãã¦ã¢ãµã¤ã³ãã¦ãã ããï¼Male ãªã©éããã®ãæå®ããã¨æ£ãããªããã·ã³ã¯åºæ¥ã¾ããï¼ãããã§ãªããã·ã³ã¯ã®è§£æãè¡ãããããã«ãªãã¾ãã
次ã«ã解æçµæãåãåã£ã¦ãã¬ã³ãã·ã§ã¤ãã«åå¿ããããã»ããã¢ãããã¾ããuLipSyncBlendShape
ãã¦ããã£ã¡ããã® SkinnedMeshRenderer
ã®ã«ã¼ãã«é
ç½®ããSinned Mesh Renderer ãã対象ã¨ãªããã¬ã³ãã·ã§ã¤ãã§ãã MTH_DEF
ãé¸æãBlend Shapes > Phoneme - BlendShape Table 㧠AãIãUãEãOãNã -ã®è¨ 7 ã¤ã®é
ç®ã + ããããããã¦è¿½å ãã¾ãï¼N ã¯ãããã- ã¯ãã¤ãºãç»é²ãã¦ããã¾ãï¼ãããã¦ãããããã®é³ç´ ã«å¯¾å¿ãããã¬ã³ãã·ã§ã¤ããç»åã®ããã«é¸æãã¾ãã
æå¾ã«ããã® 2 ã¤ãã¤ãªãã¾ããuLipSync
ã³ã³ãã¼ãã³ãã® Parameters > On Lip Sync Updated (LipSyncInfo) ã¨ããå ´æ㧠+ ãæ¼ãã¦ã¤ãã³ãã 1 ã¤è¿½å ããNone (Object) ã¨ãªã£ã¦ããã¨ããã« uLipSyncBlendShape
ã³ã³ãã¼ãã³ããã¤ãã¦ããã²ã¼ã ãªãã¸ã§ã¯ãï¼ã¾ãã¯ã³ã³ãã¼ãã³ãï¼ããã©ãã°ãããããã¾ããNo Function ã®ãã«ãã¦ã³ãªã¹ããã uLipSyncBlendShape
ãæ¢ãããã®ä¸ã«ãã OnLipSyncUpdate
ãé¸æãã¾ãã
ããã§ã·ã¼ã³ãå®è¡ããã¨å£ãåãããªããåã£ã¦ãããããã«ãªãã¾ãã
å£ãã¯ã®åå¿ã®èª¿æ´
èªèããããªã¥ã¼ã ãå£ã®åå¿é度㯠uLipSyncBlendShape
ã³ã³ãã¼ãã³ãã®ãParamteters ã®ä¸ã§è¡ãªãã¾ãã
- Volume Min/Max (Log10)
- èªèããæå°ã¨æ大ï¼å£ãéãã¦ãã / æã大ããéãï¼ã®ããªã¥ã¼ã ãè¨å®ï¼Log10 ãã¦ããã®ã§ã0.1 ãªã -1ã0.01 ãªã -2 ã¨ãªã£ã¦ã¾ãï¼
- Smoothness
- å£ãã¯ã®å¿çé度ãå°ããããã¨ãã¯ãã¯ãããã¦ãã¾ãããéã«å¤§ããã»ã©æ»ããã«ãªãã追å¾æ§ãæªããªãã®ã§é©å½ãªå¤ãé¸ãã§ãã ãã
ããªã¥ã¼ã ã«é¢ãã¦ã¯ãç¾å¨ã»æ大ã»æå°ã®é³éãã©ã®ãããã ã£ããã¨ããæ
å ±ã uLipSync
ã³ã³ãã¼ãã³ãã® Runtime Information ã¨ããä¸ã§è¦ããã¨ãåºæ¥ã¾ãã®ã§ããããåèã«è¨å®ãã¦ã¿ã¦ãã ããã
ãªã¼ãã£ãªã½ã¼ã¹ã®ä½ç½®
AudioSource
ã¯å£ã®ä½ç½®ã«ãuLipSync
ã¯ã©ããå¥ã®ã²ã¼ã ãªãã¸ã§ã¯ãã«ã¢ã¿ãããããã±ã¼ã¹ãããã¨æãã¾ãããã®éã¯ãå°ãé¢åã§ãããuLipSyncAudioSource
ã¨ããã³ã³ãã¼ãã³ãã AudioSource
ã¨åãã²ã¼ã ãªãã¸ã§ã¯ãã«è¿½å ããuLipSync
ã® Parameters > Audio Source Proxy ã«ãããã»ãããã¦ãã ããã
Samples / 03. AudioSource Proxy ããµã³ãã«ã·ã¼ã³ã¨ãªãã¾ã
ä¸èº«ã¨ãã¦ã¯ uLipSyncAudioSource
ã AudioSource
ã®çµæã OnAudioFilterRead
ã§æ¾ã£ã¦ãã¦ããããã¤ãã³ãçµç±ã§ uLipSync
ã«æ¸¡ãã¦ãã¾ãã
ãã¤ã¯ã®å©ç¨
ãã¤ã¯ãå
¥åã¨ãããå ´å㯠uLipSyncMicrophone
ã¨ããã³ã³ãã¼ãã³ãã uLipSync
ã¨åãã²ã¼ã ãªãã¸ã§ã¯ãã«è¿½å ãã¾ããããã¯ãã¤ã¯å
¥åãã¯ãªããã¨ãã AudioSource
ãçæããã³ã³ãã¼ãã³ãã§ãããµã³ãã«ã·ã¼ã³ã¯ Samples / 02-1. Mic Input ã«ãªãã¾ãã
Device ããå ¥åã«ä½¿ç¨ããããã¤ã¹ãé¸æãIs Auto Start ã«ãã§ãã¯ãå ¥ã£ã¦ããã¨èªåã§éå§ãã¾ãããã¤ã¯å ¥åã®éå§ã»åæ¢ã¯å®è¡æã«æ¬¡ã®ãã㪠UI ã«ãªãã®ã§ãStop Mic / Start Mic ãæ¼ä¸ãããã¨ã§å¯è½ã§ãã
ã¹ã¯ãªããããè¡ãå ´åã¯ã次ã®ããã« uLipSync.MicUtil.GetDeviceList()
ãå©ç¨ãã¦ä½¿ç¨ãããã¤ã¯ãç¹å®ãããã®ã¤ã³ããã¯ã¹ããã®ã³ã³ãã¼ãã³ãã® index
ã«æå®ãã¦æ¸¡ã㦠StartRecord()
/ StopRecord()
ãããã¨ã§ãéå§ã»åæ¢ãè¡ã£ã¦ãã ããã
ãªãããã¤ã¯ã®å
¥åã¯ãã®ã¾ã¾ã§ã¯èªåã®çºè©±ããå°ãé
ã㦠Unity å
ã§åçããã¦ãã¾ãã¾ããé
ä¿¡ãªã©ã§å£°ã¯å¥ã®ã½ããã§ãã£ããã£ãããã®ãå©ç¨ãããã±ã¼ã¹ãªã©ã¯ãuLipSync
ã³ã³ãã¼ãã³ãã®ãParameters > Output Sound Gain ã 0 ã«ãã¦ãã ãããAudioSource
ã® Volume ã 0 ã«ãã¦ãã¾ãã¨ãOnAudioFilterRead()
ã«æ¸¡ã£ã¦ãããã¼ã¿ãç¡é³ã«ãªã£ã¦ãã¾ã解æãåºæ¥ãªãã®ã§ã解æå¾ã« 0 ã«ããå¦çãããã§è¡ãã¾ãã
uLipSync
ã³ã³ãã¼ãã³ãã® Profile > Profile ã§é©å½ãªãµã³ãã«ä¸ã®ãããã¡ã¤ã«ï¼ç·æ§ãªã Maleã女æ§ãªã Female ãªã©ï¼ãé¸æãå®è¡ããã¨ã声ã«åããã¦å£ãã¯ããã¨æãã¾ãããã ãå人ã«ãã£ãé³å£°ã§ã¯ãªãã®ã§ãããã©ã«ãã®é³å£°ã ã¨ç²¾åº¦ã¯è¯ããªãããããã¾ããã次ã«ãããèªèº«ã®å£°ã«åããããã£ãªãã¬ã¼ã·ã§ã³ãã¼ã¿ãä½æããæ¹æ³ã«ã¤ãã¦è¦ã¦ããã¾ãã
ãã£ãªãã¬ã¼ã·ã§ã³
å
ã»ã©ã¯å
ããç¨æãã¦ãã£ã Profile
ãã¼ã¿ã使ã£ãã®ã§ãããä»ã®é³å£°åãï¼ä»ã®å£°åªããã®ãã¼ã¿ãèªåã®å£°ï¼ã«èª¿æ´ãããã¼ã¿ãä½æããæ¹æ³ã次ã«ç´¹ä»ãã¾ãã
ãããã¡ã¤ã«ã®ä½æ
uLipSync
ã³ã³ãã¼ãã³ãã® Profile > Profile > Create ãã¿ã³ãæ¼ãã¨ãã¼ã¿ã Assets ã®ã«ã¼ãã«ä½æããããã®ãããã¡ã¤ã«ãã»ããããã¾ããProject ã¦ã£ã³ãã¦ããå³ã¯ãªã㯠> uLipSync > Profile ã§ãä½æã§ãã¾ãã
次ã«èªèããããé³ç´ ã Profile > MFCC > MFCCs ã«ç»é²ãã¦ããã¾ããåºæ¬çã«ã¯ AIUEO ã§è¯ãã¨æãã¾ãããæ¯ç¨ã®é³ç´ ï¼ã-ããªã©é©å½ãªæåï¼ã追å ãã¦ããã¨æ¯ãå½ãã£ã¦ãã¾ã£ãã¨ãã«å£ããã¯ãã¯ãã¦ãã¾ãã®ãæå¶ã§ããã®ã§ããããã§ãããããã表ã N ãç»é²ãã¦ãè¯ãããããã¾ãããç»é²ããæå㯠uLipSyncBlendShape
ã¨ä¸è´ããããããã°è¯ãã®ã§ãã¢ã«ãã¡ãããã§ãã²ãããªã§ãã«ã¿ã«ãã§ãæ§ãã¾ããã
次ã«ãä½æããé³ç´ ããããããã£ãªãã¬ã¼ã·ã§ã³ãã¦ããã¾ãã
ãã¤ã¯å ¥åã使ã£ã調æ´
ã¾ãã¯ãã¤ã¯ã使ãæ¹æ³ã§ããuLipSyncMicrophone
ããªãã¸ã§ã¯ãã«è¿½å ãã¦ãã ããããã£ãªãã¬ã¼ã·ã§ã³ã¯å®è¡æã«è¡ãã®ã§ããã®ç¶æ
ã§ã²ã¼ã ãéå§ãã¾ããããã¨åé³ç´ ã®å³å´ã« Calib ã¨ãããã¿ã³ãç¾ããã®ã§ããã¤ã¯ã«åãã£ã¦ããããã®é³ç´ ã®é³ãåããªãããã®ãã¿ã³ãæ¼ä¸ãç¶ãã¦ãã ãããA ãªãããã¼ã¼ã¼ã¼ããI ãªãããã¼ã¼ã¼ã¼ã¼ã¼ãã¨ãã£ãå
·åã®ãã®ã§ãããã¤ãºã ã£ããä½ãåããªãã£ããæ¯ãå¹ãããããã¨ãã£ãæãã§ããã
äºã uLipSyncBlendShape
ãè¨å®ãã¦ããã°ããããªæãã§ã ãã ãå£ãåã£ã¦ããã®ãé¢ç½ãã§ããProfile
㯠ScriptableObject
ãªã®ã§å®è¡ãåæ¢ãã¦ããã¼ã¿ã¯ä¿åããã¾ãã
ãªããå°å£°ã¨è£å£°ãªã©ã§å£ãä¸è´ãããããªãå ´åã¯ãååã®è¤æ°é³ç´ ã Profile
ã«ç»é²ãããã¨ãåºæ¥ã¾ãã®ã§é©å®èª¿æ´ãã¦ãã ããã
é³å£°ãã¼ã¿ã使ã£ã調æ´
次ã«é³å£°ãã¼ã¿ã使ã£ããã£ãªãã¬ã¼ã·ã§ã³æ¹æ³ã§ããããã¼ã¼ã¼ã¼ã¼ããããã¼ã¼ã¼ã¼ã¼ãã¨åã£ã¦ãããé³å£°ãããã°ãããã«ã¼ãåçããç¶æ
ã§åæ§ã« Calib ãã¿ã³ãæ¼ä¸ãã¦ãã ããããã 大ä½ã®ã±ã¼ã¹ã§ã¯ãããªé³å£°ãç¡ãã®ã§æ¢åã®é³å£°ã®ããã¼ã¼ãã£ã½ãé¨åãããã¼ã¼ãã£ã½ãé¨åãããªãã³ã°ãã¦åçãããã¨ã§ãã£ãªãã¬ã¼ã·ã§ã³ãå®ç¾ãããã§ããããã§ä¾¿å©ãªã³ã³ãã¼ãã³ãã uLipSyncCalibrationAudioPlayer
ã³ã³ãã¼ãã³ãã§ããããã¯é³å£°æ³¢å½¢ãè¦ãªããåçãããé¨åãã¡ãã£ã¨ã¯ãã¹ãã§ã¼ããããªããã«ã¼ãåçãã¦ãããã³ã³ãã¼ãã³ãã§ãã
å¢çããã©ãã°ããªããããã¼ãã¨è¨ã£ã¦ããããªé¨åãé¸æãããã®ç¶æ
ã§ããããã®é³ç´ ã® Calib ãã¿ã³ãæ¼ä¸ã㦠Profile
ã« MFCC ãç»é²ãã¦ãã ããã
ãã£ãªãã¬ã¼ã·ã§ã³ã®ã³ã
ãã£ãªãã¬ã¼ã·ã§ã³ããéã¯ä»¥ä¸ã®ãã¨ã«æ°ãã¤ããã¨è¯ãã§ãã
- ãªãã¹ããã¤ãºã®ãªãç°å¢ã§è¡ã
- ç»é²ãã MFCC ããªãã¹ãä¸å®ã«ãªã£ã¦ãããã«ãã
- 横軸 12 次å ããããã¬ã¼ã ã® MFCC ã§ãå é¨çã«ã¯ç¸¦ã®å¹³åãåã£ã¦æ¯è¼ãã¾ã
- ãã£ãªãã¬ã¼ã·ã§ã³å¾ã«ä½åº¦ããã§ãã¯ãã¦ãã¾ãè¡ããªãé³ç´ ã¯ãã£ãªãã¬ã¼ã·ã§ã³ãç´ãããå¥ã®é³ç´ ã¨ãã¦ç»é²ããããã
- è¤æ°ã®ååé³ç´ ãç»é²ã§ããã®ã§å£°è²ãå¤ããã¨ãã«åããªãå ´åã¯ããããã追å ã§ç»é²ãã¦ã¿ã¦ãã ãã
- ã©ããã¦ãåããªãã¨ãã¯èª¤ã£ãé³ç´ ãç¡ãã確èªãã
- ååã®é³ç´ 㧠MFCC ã®è²ã®ãã¿ã¼ã³ãããããéããã®ã¯ééã£ã¦ããå¯è½æ§ãããã¾ãï¼åãé³ç´ ã¯ä¼¼ããããªãã¿ã¼ã³ã«ãªãã¯ãï¼
- ãã£ãªãã¬ã¼ã·ã§ã³å¾ã®ãã§ãã¯æ㯠Runtime Information ãæããããã§ãã ãã
- æ¯ãã¬ã¼ã ã¨ãã£ã¿ã®åæç»ãè¡ãããã®ã§ãã¬ã¼ã ã¬ã¼ãã 60 ãå²ããã¨ãããã¾ã
ãªããã·ã³ã¯ã®äºåè¨ç®
ãã¦ãããã¾ã§ã¯ã©ã³ã¿ã¤ã ã®å¦çã«ã¤ãã¦è¦ã¦ãã¾ãããããããã¯äºåè¨ç®ã«ãããã¼ã¿ã®å¶ä½ã«ã¤ãã¦è¦ã¦ããã¾ãã
ä»çµã¿
ãªã¼ãã£ãªãã¼ã¿ãããå ´åã¯æ¯ãã¬ã¼ã ã©ããªè§£æçµæã渡ã£ã¦ãããäºåã«è¨ç®å¯è½ãªã®ã§ãããã BakedData
ã¨ãã ScriptableObject
ã«ç¼ãè¾¼ãã§ããã¾ããå®è¡æã«ã¯ã©ã³ã¿ã¤ã ã§è§£æãã¦ãã uLipSync
ã®ä»£ããã«ãuLipSyncBakedDataPlayer
ã¨ããã³ã³ãã¼ãã³ããä»ãã¦åçããããã«ãã¾ãããã㯠uLipSync
ã¨åæ§ã«è§£æçµæãã¤ãã³ãã§éç¥ãããã¨ãã§ãããããuLipSyncBlendShape
ãç»é²ãã¦ãããã¨ã§ãªããã·ã³ã¯ãå®ç¾ã§ãã¾ãããã®æµããå³ç¤ºããã¨ä»¥ä¸ã®ããã«ãªãã¾ãã
JobSystem ã¯å®è¡ä¸ã§ãªãã¦ãåãããã¨ãåºæ¥ãã®ãè¯ãã§ããã
ã»ããã¢ãã
ãµã³ãã«ã·ã¼ã³ã¯ Samples / 05. Bake ã«ãªãã¾ããProject Window ãã Create > uLipSync > BakedData 㧠BakedData
ãä½æã§ãã¾ãã
ããã§ããã£ãªãã¬ã¼ã·ã§ã³ãã Profile
ã¨ãã®é³å£°ã§ãã AudioClip
ãæå®ããBake ãã¿ã³ãæ¼ä¸ããã¨ãã¼ã¿ã®è§£æãè¡ãããã¼ã¿ãå®æãã¾ãã
æ¯è¼çãã¾ãããã¨ä»¥ä¸ã®ãããªãã¼ã¿ãåºæ¥ã¾ãã
ãã®ãã¼ã¿ã uLipSyncBakedDataPlayer
ã«ã»ãããã¾ãã
ããã§åçããã° OK ã§ããã¨ãã£ã¿ä¸ã§ä½åº¦ããã§ãã¯ãããå ´å㯠Play ãã¿ã³ãæ¼ä¸ãå¥ã¹ã¯ãªããããåçãããå ´å㯠Play()
ãå¼ãã§ãã ããã
çµæ
ä½åãæ¯é³ãééã£ã¦ãã¦ãæ£ç´ããã»ã©å¤ã«ã¯è¦ããããã£ã½ãè¦ãã¾ãã
ãã©ã¡ã¿
Time Offset ã¨ããã¹ã©ã¤ãã調æ´ããã¨ãå£ãã¯ã®ã¿ã¤ãã³ã°ãæ©ãããé ããããåºæ¥ã¾ããã©ã³ã¿ã¤ã 解æã ã¨å£°ããå ã«å£ãéãã¦ãããã¿ãããªèª¿æ´ã¯ã§ãã¾ããããäºå解æã ã¨å°ãæ©ãã¦å£ãéããããã®ã§å°ãèªç¶ã«è¦ããã調æ´ãã§ãã¾ãã
ä¸æ¬å¤æâ
ãã¹ã¦ã®ãã£ã©ã¯ã¿ãã¤ã¹ã® AudioClip
ãä¸æ¬ã§ BakedData
ã¸å¤æãããã±ã¼ã¹ãããã¨æãã¾ãããã®éã¯ãWindow > uLipSync > Baked Data Generator ãå©ç¨ãã¦ãã ããã
ä¸æ¬å¤æããéã«ä½¿ç¨ããã Profile
ãé¸æãã対象ã¨ãªã AudioClip
ãé¸æãã¾ããInput Type ã List ã®å ´åã¯ç´æ¥ AudioClip* ãç»é²ãã¦ãã ããï¼*Project* ã¦ã£ã³ãã¦ããè¤æ°é¸æã§ãã©ãã°ããããããã¨æ¥½ã§ãï¼ã*Directory* ã«ããå ´åã¯ããã¡ã¤ã«ãã¤ã¢ãã°ãéããã£ã¬ã¯ããªãæå®ã§ãããã®ãã£ã¬ã¯ããªä»¥ä¸ã®
AudioClip` ãèªåã§åæãã¦ããã¾ãã
Generate ãã¿ã³ãæ¼ãã¨å¤æãå§ã¾ãã¾ãã
ä¸æ¬å¤æâ¡
æ¢ã«ä½æãããã¼ã¿ãæãéããã£ãªãã¬ã¼ã·ã§ã³ãè¦ç´ã㦠Profile
ãå¤æ´ããã±ã¼ã¹ãåºã¦ããã¨æãã¾ãããã®éã¯ãåãããã¡ã¤ã«ã® Baked Data ã¿ãã®ä¸ã« Reconvert ãã¿ã³ãããã®ã§ããããæ¼ä¸ãããã¨ã§ä¸æ¬å¤æãããã¨ãå¯è½ã§ãã
ã¿ã¤ã ã©ã¤ã³é£æº
BakedData
ã使ç¨ãããã¨ã§ãTimeline é£æºãå¯è½ã«ãªãã¾ããã
ä»çµã¿
Timeline ã«å°ç¨ã®ãã©ãã¯ã¨ã¯ãªããã追å ã§ããããã«ãã¾ããããã®ä¸ã§ãã®ã¿ã¤ã ã©ã¤ã³ã®ãã¼ã¿ã使ã£ã¦ã©ã®ãªãã¸ã§ã¯ããåããã®ãã¨ãããã¤ã³ãã£ã³ã°ãè¡ããªããã°ãªãã¾ãããããã§ãåçæ
å ±ãåãåã£ã¦ uLipSyncBlendShape
ã¸ã¨éç¥ããããã® uLipSyncTimelineEvent
ã¨ããã³ã³ãã¼ãã³ããå°å
¥ãã¾ãããå³ç¤ºããã¨ä»¥ä¸ã®ãããªæµãã«ãªãã¾ãã
ã»ããã¢ãã
Timeline ä¸ã®ãã©ãã¯ã®ã¨ãªã¢ã§å³ã¯ãªãã¯ããuLipSync.Timeline > U Lip Sync Clip ããå°ç¨ã®ãã©ãã¯ã追å ãã¾ãããã®ãã©ãã¯ã§å³ã¯ãªãã¯ãã¯ãªããã追å ãã¾ããBakedData
ãç´æ¥ãã©ãã°ãããããã¦ã OK ã§ãã
追å ãããã©ãã¯ãé¸æããã¨ã¤ã³ã¹ãã¯ã¿ã«ã¯æ¬¡ã®ãã㪠UI ã表示ããã¾ããBakedData
ã®å·®ãæ¿ããããã§åºæ¥ã¾ã
ããã¦ãããå®éã«åçãã¦å£ãã¯åºæ¥ãããã«ãã¤ã³ãã£ã³ã°ããã¦ããã¾ããuLipSyncTimelineEvent
ãä½ããã®ã²ã¼ã ãªãã¸ã§ã¯ãã«è¿½å ãã¾ãã
ãã®ã¨ããOn Lip Sync Update (LipSyncInfo) ã«ã¯ uLipSyncBlendShape
ãç»é²ãã¦ããã¾ãã
ãã㦠PlayableDirector
ã®ã¤ãã¦ããã²ã¼ã ãªãã¸ã§ã¯ããã¯ãªãã¯ããTimeline ã¦ã£ã³ãã¦ã® uLipSyncTrack
ä¸ã®ãã¤ã³ãã£ã³ã°ããã¹ãããã«ããã®ã²ã¼ã ãªãã¸ã§ã¯ãããã©ãã°ãããããã¾ãã
ãã㧠uLipSyncTimelineEvent
ã¸ãªããã·ã³ã¯æ
å ±ãé£ãã§ããããã«ãªããuLipSyncBlendShape
ã¸ã®æ¥ç¶ãåºæ¥ã¾ãããåçã¯ã©ã³ã¿ã¤ã ã§ãªãã¦ãåºæ¥ã¾ãã®ã§ã¢ãã¡ã¼ã·ã§ã³ã¨ä½µããã調æ´ãåºæ¥ã¾ãã
VRM 対å¿
VRM ã®ãã¬ã³ãã·ã§ã¤ã㯠VRMBlendShapeProxy
ã¨ããã³ã³ãã¼ãã³ããä»ãã¦å¶å¾¡ããã¾ãã
uLipSyncBlendShape
ã§ã¯ SkinnedMeshRenderer
ãç´æ¥å¼ã£ã¦ã¾ãããã代ããã«ããã使ãããä¿®æ£ãã uLipSyncBlendShapeVRM
ã¨ããã³ã³ãã¼ãã³ãã Samples/04. VRM ã«å«ã¾ãã¦ãã¾ãã04. VRM ã·ã¼ã³ã¯ VRM ã®ã»ããã¢ããããã¦ニコニ立体ちゃんãã¤ã³ãã¼ããã¦ããã°åçã§ãã¾ãã
ãã®ä» Tips
ç¬èªã¤ãã³ãã®è¿½å
uLipSyncBlendShape
㯠3D ã§ããã代ããã«ãã¯ã¹ãã£ã¢ãã¡ã¼ã·ã§ã³ããããããã¿ãããªã±ã¼ã¹ã§ã¯èªåã§ã³ã³ãã¼ãã³ããæ¸ãã¦å¯¾å¿ããããã¨ãåºæ¥ã¾ããå
·ä½çã«ã¯ uLipSync.LipSyncInfo
ãåãåãé¢æ°ãç¨æããã³ã³ãã¼ãã³ããç¨æããããã uLipSync
ã uLipSyncBakedDataPlayer
ã®OnLipSyncUpdate(LipSyncInfo)
ã«ç»é²ãã¾ãã
以ä¸ã¯èªèããçµæã Debug.Log()
åºåããç°¡åãªã¹ã¯ãªããã®ä¾ã§ãã
using UnityEngine; using uLipSync; public class DebugPrintLipSyncInfo : MonoBehaviour { public void OnLipSyncUpdate(LipSyncInfo info) { if (!isActiveAndEnabled) return; if (info.volume < Mathf.Epsilon) return; Debug.LogFormat($"PHENOME: {info.phoneme}, VOL: {info.volume} "); } }
LipSyncInfo
ã¯æ¬¡ã®ãããªæ§é ä½ã§ãã
public struct LipSyncInfo { public string phoneme; // æãè¿ãé³ç´ public float volume; // æ£è¦åãããããªã¥ã¼ã ï¼0 ~ 1ï¼ public float rawVolume; // ããªã¥ã¼ã ã®çå¤ public Dictionary<string, float> phonemeRatios; // é³ç´ ã¨ãã®å²åã®ãã¼ãã« }
JSON ã¸ã®ä¿å / èªã¿è¾¼ã¿
å¤é¨ãã¡ã¤ã«ã¨ã®ããåãç¨ã«ãProfile
ã® JSON ã¸ã®ä¿åã»èªã¿è¾¼ã¿ãåãã¦ãã¾ããã¨ãã£ã¿ãã㯠Import / Export JSON ã¿ãããä¿åã»èªã¿è¾¼ã¿ããã JSON ãæå®ããImport ã¾ã㯠Export ãã¿ã³ãæ¼ä¸ãã¦ãã ããã
ã³ã¼ãã§è¡ãããå ´åã¯æ¬¡ã®ãããªã³ã¼ãã§å¯è½ã§ãã
var lipSync = GetComponent<uLipSync>(); var profile = lipSync.profile; // Export profile.Export(path); // Import profile.Import(path);
ã©ã³ã¿ã¤ã ã§ã®ãã£ãªãã¬ã¼ã·ã§ã³
ã©ã³ã¿ã¤ã ã§ãã£ãªãã¬ã¼ã·ã§ã³ãè¡ãããã¨ãã¯ã次ã®ããã« uLipSync
ã«å¯¾ã㦠uLipSync.RequestCalibration(int index)
ã§ãªã¯ã¨ã¹ããè¡ããã¨ã§å¯è½ã§ããç¾å¨åçããã¦ããé³ããè¨ç®ãã MFCC ãæå®ããé³ç´ ã«è¨å®ããã¾ãã
lipSync = GetComponent<uLipSync>(); for (int i = 0; i < lipSync.profile.mfccs.Count; ++i) { var key = (KeyCode)((int)(KeyCode.Alpha1) + i); if (Input.GetKey(key)) lipSync.RequestCalibration(i); }
å®éã®åä½ã¯ CalibrationByKeyboardInput.cs ã§ç¢ºèªãã¦ãã ãããã¾ãããã«ãå¾ã® Profile
ã®ä¿åã復å
㯠JSON ã§è¡ãã®ãè¯ããã¨æãã¾ãã
WebGL ã§ã®åä½
うえぞうさんã WebGL ã¨ã®ã¤ãªãã試ãã¦ä¸ãã£ã¦ã¾ãããå°ãæãå ¥ãã㨠WebGL ã§ãåä½ã§ããããã§ããã調æ»ãããã¨ããããã¾ãã
Mac ã§ã®ãã«ã
Mac ã§ãã«ãæã«æ¬¡ã®ãããªã¨ã©ã¼ã«åºããããã¨ãããã¾ãã
Building Library/Bee/artifacts/MacStandalonePlayerBuildProgram/Features/uLipSync.Runtime-FeaturesChecked.txt failed with output: Failed because this command failed to write the following output files: Library/Bee/artifacts/MacStandalonePlayerBuildProgram/Features/uLipSync.Runtime-FeaturesChecked.txt
ããã¯ãã¤ã¯ã®ã¢ã¯ã»ã¹ã³ã¼ãã«é¢é£ãã¦ããå¯è½æ§ãããã¾ãããProject Settings > Player ã® Other Settings > Mac Configuration > Microphone Usage Description ã«ä½ããæ¸ãã¨ä¿®æ£ããã¾ãã
ååããã®å°ããªå¤æ´
ããã¾ã§ã®å©ç¨è ã®æ¹åãã«ä¸è¨æ°æ©è½ä»¥å¤ã®å·®åæ å ±ã§ãã
ãã©ã¡ã¿ã®æ´ç
ååãã㯠Profile
ã«ç»é²ããæ
å ±ã¨ uLipSyncBlendShape
ã«ç»é²ããæ
å ±ã®åãåãããã£ã¨ãããã«ãã¾ãããå
·ä½çã«ã¯ãMFCC ã®ç®åºã«å¿
è¦ãªæ
å ±ã®ã¿ã Profile
ã«æ ¼ç´ããããã«ãããªããã·ã³ã¯é¢é£ã®ãã©ã¡ã¿ãªã©ã¯ uLipSyncBlendShape
ãåãæã¤ããã«ãã¾ãããã¾ãä½µãã¦ä¸è¦ãªãã©ã¡ã¿ã¯å»æ¢ãã極åè¨å®é
ç®ãå°ãªããªããã調æ´ãã¾ããã
ãã¬ã³ãã·ã§ã¤ãã¸ã®åæ æ¹å
以åã¯ã解æã®çµæããæãè¿ãåä¸ã®æ¯é³ãé¸ãã§ãã¾ãããããããã¨ãããã®ä¸éã¿ãããªé³ã ã£ããå£ããã©ãã©åãæ¿ãã£ã¦ãã¾ã£ã¦ããã®ã§ãè·é¢ãããããè¨ç®ããæ¬å½ã«ä¸éã ã£ãã 0.5ã0.5 ã¨ãªããããªå½¢ã§ãã¬ã³ãã·ã§ã¤ãã«åæ ãããããã«ä¿®æ£ãã¾ããã
ãªã¹ã表示æ¹å
å¾ã¯ç´°ããã§ãããèªåã§æ¸ãã¦ãããªã¹ãã® UI ã ReorderableList
ã使ãããã«ãã¦ããç´æçã«è¿½å ã»åé¤ã»ä¸¦ã³æ¿ããåºæ¥ãããã«ãã¾ããã
ãããã«
ãã¼ã¸ã§ã³ãéããæ¯ã«ç ´å£çå¤æ´ããã¦ãã¦ç³ã訳ããã¾ããâ¦ã次ã®å¤§ããªæ´æ°ã¯ãã¤ã«ãªããåããã¾ããããç¾ç¶ãããã¡ã¤ã«ã«ç»é²ãããåé³ç´ ã¨ã®èª¤å·®ã調ã¹ã¦æå°ã«ãªããã®ãé¸æããé¨åããä½ãããè³¢ãææ³ã«ããã¨ãããããããã¨èãã¦ãã¾ãï¼ããããæå°è·é¢ã¨ããã®ãããªãææãã§ã¯ããã¾ãâ¦ï¼ãã¾ãããã¬ã³ãã·ã§ã¤ãã®ã¢ãã¡ã¼ã·ã§ã³ã¸ã®å¤æãèãã¦ãã¾ãããã¡ãã¯ãã¤ãã¼ãã¼ã¸ã§ã³ã«ããã¢ãããã¼ãã§è¿æ¥ä¸ã«è¡ãäºå®ã§ãã
ä»åãã¿ã¤ã ã©ã¤ã³ã®æ¡å¼µãªã©ã試ãã¦è²ã ã¨é¢ç½ãã£ãã®ã§ããã®è¾ºãã¯ã¾ãå¥è¨äºã«ã¾ã¨ãããã¨æãã¾ãã
ã©ã¤ã»ã³ã¹
© Unity Technologies Japan/UCL