🚀. Socket Launch Week Day 2:Introducing Manifest Alerts.Learn more
Sign In

use-lipsync

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-lipsync

React hook for text-driven lip sync with ARKit morph targets and Indic language support

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

use-lipsync

React hook for text-driven lip sync with ARKit morph targets. Supports English + Indian languages (Hindi, Tamil, Telugu, Kannada, Malayalam).

Install

npm install use-lipsync

Usage

import { useRef, useState } from "react";
import { useLipSync } from "use-lipsync";

function Avatar() {
  const audioRef = useRef(null);
  const [isPlaying, setIsPlaying] = useState(false);
  const [morphValues, setMorphValues] = useState({ jawOpen: 0, mouthFunnel: 0, mouthSmileLeft: 0, mouthSmileRight: 0 });

  const handleMorphUpdate = ({ jawOpen, mouthFunnel, mouthSmileLeft }) => {
    // Apply these morph targets to your 3D model
  };

  useLipSync(audioRef, isPlaying, handleMorphUpdate, "வணக்கம் hello");

  return (
    <audio
      ref={audioRef}
      src="speech.mp3"
      onPlay={() => setIsPlaying(true)}
      onEnded={() => setIsPlaying(false)}
    />
  );
}

API

useLipSync(audioRef, isPlaying, onMorphUpdate, spokenText)

ParamTypeDescription
audioRefRefObject<HTMLAudioElement>Ref to the audio element
isPlayingbooleanWhether audio is currently playing
onMorphUpdate(morphs) => voidCallback with { jawOpen, mouthFunnel, mouthSmileLeft }
spokenTextstringThe text being spoken (supports Indic scripts)

Supported Languages

  • English (passthrough)
  • Hindi (Devanagari)
  • Tamil
  • Telugu
  • Kannada
  • Malayalam

Keywords

lipsync

FAQs

Package last updated on 03 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts