{"_id":"wawa-lipsync","_rev":"2-4e1532a3f47eac60eb47269b40113727","name":"wawa-lipsync","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"wawa-lipsync","version":"0.0.1","keywords":["react","three","react-three","react-three-fiber","react-three-drei","lipsync","babylonjs"],"license":"MIT","_id":"wawa-lipsync@0.0.1","maintainers":[{"name":"wass08","email":"wass08@gmail.com"}],"dist":{"shasum":"77d62b47967cd730f09283030afd3fd2bf6c46a8","tarball":"https://registry.npmjs.org/wawa-lipsync/-/wawa-lipsync-0.0.1.tgz","fileCount":7,"integrity":"sha512-4ynJX3LcztOi1vvnfzxxXiqewYxd1teY2EpQ+YfOT8T0WvUXlRouJ15gaBXabFe8eHq2EB8C5X5aGYxrNM1Daw==","signatures":[{"sig":"MEYCIQD1z1yu1P6Hpr3ixtU3nwhpJJuUjoGl0XTB7VUvA4BNIAIhAP5YWSBnRBvK5+0zr/2H+iA8NJUZl29qDjV3vEs8iscR","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":124154},"main":"dist/wawa-lipsync.umd.js","types":"dist/index.d.ts","module":"dist/wawa-lipsync.es.js","exports":{"types":"./dist/index.d.ts","import":"./dist/wawa-lipsync.es.js","require":"./dist/wawa-lipsync.umd.js"},"gitHead":"fe3ad077ca18ac5cf640ca1139813a4d7fef977a","private":false,"scripts":{"dev":"vite","build":"cp ../../README.md ./ && vite build","preview":"vite preview"},"_npmUser":{"name":"wass08","actor":{"name":"wass08","type":"user","email":"wass08@gmail.com"},"email":"wass08@gmail.com"},"_npmVersion":"10.9.2","description":"A simple and easy-to-use library for real-time lipsyncing with JS and web audio API.","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^6.2.0","globals":"^15.15.0","typescript":"^5.8.2","vite-plugin-dts":"^4.5.3"},"_npmOperationalInternal":{"tmp":"tmp/wawa-lipsync_0.0.1_1750227407678_0.6985800939517626","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"wawa-lipsync","private":false,"version":"0.0.2","license":"MIT","types":"dist/index.d.ts","main":"dist/wawa-lipsync.umd.js","module":"dist/wawa-lipsync.es.js","keywords":["react","three","react-three","react-three-fiber","react-three-drei","lipsync","babylonjs"],"description":"A simple and easy-to-use library for real-time lipsyncing with JS and web audio API.","exports":{"types":"./dist/index.d.ts","import":"./dist/wawa-lipsync.es.js","require":"./dist/wawa-lipsync.umd.js"},"scripts":{"dev":"vite","build":"cp ../../README.md ./ && vite build","preview":"vite preview"},"devDependencies":{"globals":"^15.15.0","typescript":"^5.8.2","vite":"^6.2.0","vite-plugin-dts":"^4.5.3"},"_id":"wawa-lipsync@0.0.2","gitHead":"3749586fda061fa9ab0404d4dabc257de1f56c14","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-aW4vKMOBRsv2RnPugzB0fF0ln1ni3kE3INks9xxeQ8+RnL6uZZzenzn/dwdwji8BBD8IboJBatFj/WkoyyYaew==","shasum":"1babc388a063e9ba8ed8e7b74a8683e542e5c6a7","tarball":"https://registry.npmjs.org/wawa-lipsync/-/wawa-lipsync-0.0.2.tgz","fileCount":7,"unpackedSize":125294,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCAjCfd1YLvjRMrD8JM/nU4+H3K50r0Ge9gEE4XMDk49gIgcUDVKlM5dhEGat5ZvMhCdPFzSQL6pdAAITj1X78oeFA="}]},"_npmUser":{"name":"wass08","email":"wass08@gmail.com"},"directories":{},"maintainers":[{"name":"wass08","email":"wass08@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wawa-lipsync_0.0.2_1762516847020_0.7495391527011521"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-18T06:16:47.677Z","modified":"2025-11-07T12:00:47.422Z","0.0.1":"2025-06-18T06:16:47.926Z","0.0.2":"2025-11-07T12:00:47.222Z"},"license":"MIT","keywords":["react","three","react-three","react-three-fiber","react-three-drei","lipsync","babylonjs"],"description":"A simple and easy-to-use library for real-time lipsyncing with JS and web audio API.","maintainers":[{"name":"wass08","email":"wass08@gmail.com"}],"readme":"# Wawa Lipsync\n\nA **simple** and **easy-to-use** library built in TypeScript for **real-time lipsyncing with JS and web audio API**. Ideal for animating 2D/3D characters in web apps, chatbots, and games.\n\nThe examples shows how to use the library with a 3D model in Three.js with React Three Fiber.\n\n[Live demo](https://wawa-lipsync.wawasensei.dev/)\n\n## Installation\n\n```bash\nnpm install wawa-lipsync\n```\n\nor\n\n```bash\nyarn add wawa-lipsync\n```\n\n## Usage\n\nFirst, import the library and create a `Lipsync` instance:\n\n```javascript\nimport { Lipsync } from \"wawa-lipsync\";\n\nexport const lipsyncManager = new Lipsync();\n```\n\nThen, you need to connect the [HTML `<audio>` element](https://www.w3schools.com/html/html5_audio.asp) to the `lipsyncManager`:\n\n```javascript\nconst audioElement = new Audio(\"path/to/your/audio/file.mp3\");\n\nlipsyncManager.connectAudio(audioElement);\n```\n\nThe [AnalyserNode](https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode) used by the library requires the audio element to have a valid source before the connection.\n\nThis will work:\n\n```javascript\nconst audioElement = new Audio();\naudioElement.src = \"path/to/your/audio/file.mp3\";\nlipsyncManager.connectAudio(audioElement);\n```\n\nBut this will not:\n\n```javascript\nconst audioElement = new Audio();\nlipsyncManager.connectAudio(audioElement);\n```\n\nAfter connecting the audio element, you can start the lipsyncing process by calling the `processAudio` method at the desired interval:\n\n```javascript\nconst analyzeAudio = () => {\n  requestAnimationFrame(analyzeAudio);\n  lipsyncManager.processAudio();\n  const viseme = lipsyncManager.viseme;\n  // You can now use the viseme for your animation logic\n  console.log(viseme);\n};\n\nanalyzeAudio();\n```\n\n## Example\n\nYou can find a [complete example](https://github.com/wass08/wawa-lipsync/tree/main/examples/lipsync-demo) of how to use the library with Three.js and React Three Fiber in the `examples/lipsync-demo` directory of the repository.\n\n> If you need help, join the [Discord server](https://wawasensei.dev/discord) or open an issue on the [GitHub repository](http://github.com/wass08/wawa-lipsync).\n\n## Contributions\n\nContributions are welcome! If you have any ideas, suggestions, or improvements, feel free to open an issue or submit a pull request on the [GitHub repository](http://github.com/wass08/wawa-lipsync).\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](https://github.com/wass08/wawa-lipsync/blob/main/LICENSE) for more details.\n","readmeFilename":"README.md"}