npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

motion-canvas-narrator

v0.1.0

Published

A Motion Canvas component for handling narration and subtitles with AI provider support

Readme

Motion Canvas Narrator:

Motion Canvas Narrator seamlessly integrates narration into your Motion Canvas workflow. Inspired by Motion Canvas' idea of letting your code define your animations, this package allows you to define narrations in code, making it easy to synchronize voiceovers and subtitles with your animations. You define your narrations and let them guide you through your voice recordings while displaying subtitles in the editor - or you let AI generate the audio for you.

Please note that this package is still in early development, so some bugs and missing features are expected. Contributions and suggestions are highly welcome!

Demo Video (Make sure to enable audio!)

https://github.com/user-attachments/assets/bafdc53d-0370-4efa-b15d-4376cd10462b

The source code is available here: Example Project

Features

  • Narration in Code: Define your narrations directly in your Motion Canvas code.
  • AI Narration: Use AI to generate voiceovers from text.
  • Custom Providers: Easily add your own TTS providers (contributions welcome!).
  • Server Caching: Cache audio files on the server to avoid re-generating them.
  • Mock Narrator: For testing without audio generation, useful for planning scripts and subtitles.

Provider Support

| Provider | TTS | Voice Cloning | Fine Grained Timestamps | Remarks | |--------------------|:----------:|:---------------------:|:-------------------------------:|------------------| | ElevenLabs | ✅ | | | Requires Account | | Open AI | | | | Missing | | Google TTS | | | | Missing | | speechify | | | | Missing |

Other potential providers:

  • piper1: GPL licensed, can be easily set up on your machine.
  • Web Speech API: Built-in browser TTS, no API key required, but does not support exporting audio files.
  • speechify

Planned Features

  • In-Editor Recording: Record your own narrations directly in the Motion Canvas editor.
  • Subtitles: Display precise subtitles with your narrations (check out the example project for rudimentary subtitles).
  • Caption Export: Export subtitles in various formats (e.g., WebVTT).
  • Detailed Timestamping: Timestamps for individual characters and words allow better synchronization and subtitles (example).

Usage

Using Motion Canvas Narrator in your Motion Canvas project is straightforward and only requires a few steps to set up. You can also check out the example project that includes subtitles used for the demo video here: Example Project

1. Install the Package

npm install https://github.com/prathje/motion-canvas-narrator.git

2. Enable the Narrator Plugin in your vite.config.ts

This plugin is responsible for caching audio files on the server, so you don't have to re-generate them every time you run your project. You only need to add the plugin to your vite.config.ts file:

import {defineConfig} from 'vite';
import motionCanvas from '@motion-canvas/vite-plugin';
import ffmpeg from '@motion-canvas/ffmpeg';

import { motionCanvasNarratorPlugin } from 'motion-canvas-narrator/vite-plugin';

export default defineConfig({
  plugins: [
    motionCanvas(),
    ffmpeg(), // make sure that you setup ffmpeg to export audio as well
    // Add the narrator plugin for server-side audio caching:
    motionCanvasNarratorPlugin(),
  ]
});

3. Create a Narrator (e.g., using ElevenLabs)

The narrator serves as the primary interface for generating audio from text.

import { createElevenLabsNarrator } from 'motion-canvas-narrator';
const narrator = createElevenLabsNarrator({
    modelId: 'eleven_v3',
    voiceId: 'JBFqnCBsd6RMkjVDRZzb',
    apiKey: '<YOUR_ELEVENLABS_API_KEY>'
});

4. Use the Narrator in Your Motion Canvas Project

To use the narrator, you can start narrations in your scenes as simply as:

  yield* narrator.speak("Welcome!");

This will generate frames for the duration of the narration. Note that the narration seamlessly integrates with Motion Canvas' animation system, allowing you to synchronize animations with the narration, using all for example:

  yield* all(
      // ... other animations ...
    narrator.speak("Welcome!")
  );

Contributing

If you'd like to contribute to this project, please feel free to open issues or pull requests.