Upgrade to Pro — share decks privately, control downloads, hide ads and more …

LINEで通話してくれる妹の作り方

uezo
December 16, 2021

 LINEで通話してくれる妹の作り方

LINE Developer Community 忘年LT大会での登壇資料。WebGLをLIFFで動かします。

uezo

December 16, 2021
Tweet

More Decks by uezo

Other Decks in Technology

Transcript

  1. LINE Unity WebGL LINE Platform 2021.12.16 LINE Developer Community LT

  2. UFJ DX uezo @uezochan

  3. ⚫ ⚫ 2006 https://forest.watch.impress.co.jp/ docs/serial/moritalk/528628.html

  4. BOT ⚫ ⚫

  5. CLOVA ⚫

  6. Gatebox ⚫ Gatebox

  7. 2018.3 2021.12 3 100

  8. BOT CLOVA Gatebox ? LINE We are here

  9. https://youtu.be/CSS_N3GYheU

  10. LIFF ⚫ ⚫ LINE LINE LIFF App

  11. Unity WebGL on LIFF Azure Speech Services ⚫ Unity WebGL

    LIFF ⚫ ⚫ ⚫ ⚫ Conversation Service FastAPI / Python Reminder Service (FastAPI / Python) VOICEROID Server ⚫ ⚫ ⚫ Push ⚫ ⚫ VOICEROID2 + pyvcroid2 FastAPI REST API Server LINE ⚫ Microphone WebGL Library ⚫ SALSA & Amplitude ⚫ ChatdollKit ⚫ Cygnet 3D
  12. WebGL 1. 5 10 2. dlopen, you need to use

    linking support, see https://github.com/kripken/emscripten 👉 3. C# async/await 👉 JS UniTask 4. .NET HttpClient 👉UnityWebRequest UniTask await 5. HTTP 👉Web CORS 6. Microphone 👉 Microphone WebGL Library 7. 👉 8. 16,000Hz 👉44100Hz 9. AudioClip.GetData() 👉Unity Wav 10. DownloadHandlerAudioClip.GetContent() 👉PCM AudioClip.Cleate() 11. MP3 TTS 👉 44,100Hz 20,050Hz 12. 👉 SALSA + Amplitude 13. UI 👉
  13. LIFF WebGL Tips Unity jslib JS LINE RequireLiffToken() sessionStorage ⚫

    LIFF Unity ⚫ Unity Web GL jslib ⚫ ⚫ init() iframe with liff.init() liff.getAccessToken() AccessToken setItem JS getItem AccessToken sendLiffToken() setLiffToken() & https://developers.line.biz/ja/docs/liff/opening-liff-app/#redirect-flow See also: LIFF URL LIFF
  14. LIFF WebGL Tips <script> window.liff = liff; window.sendLiffToken = function()

    { var liffToken = window.sessionStorage.getItem("LiffAccessToken"); unityInstance.SendMessage("Cygnet_MidiDress", "SetLiffToken", liffToken); } </script> Unity jslib using System.Runtime.InteropServices; using UnityEngine; public class LiffController : MonoBehaviour { [DllImport("__Internal")] private static extern void RequireLiffToken(); public string LiffAccessToken { private set; get; } private void Start() { // Request to HTML to call SetLiffToken RequireLiffToken(); } // HTML calls this method to pass the liff token public void SetLiffToken(string liffToken) { LiffAccessToken = liffToken; } } mergeInto(LibraryManager.library, { CloseLiffWindow: function () { window.liff.closeWindow(); }, RequireLiffToken: function () { window.sendLiffToken(); } }); JS
  15. ⚫LINE ⚫ WebGL WebGL ⚫ LIFF ⚫Enjoy creating app on

    LINE Platform!
  16. 👋 uezo @uezochan