Giter Club home page Giter Club logo

rollup-audio-worklet-demo's Introduction

Rollup Audio Worklet Demo

This repo serves as a demonstration of how to import and package audio worklets using Rollup.

The use case is for packages that wish to internally use the Audio Worklet API, and are unable to ask all consuming web apps to serve a bundle file directly.

This hack uses a modified rollup-plugin-web-worker-loader to encode the bundled Audio Worklet as a blob that can be included in a main package bundle. Specifically, the included bundle was generated using this patch: hughrawlinson/rollup-plugin-web-worker-loader#1. I hope to develop this further and have it merged into upstream.

The demo is shown in index.html, and should work in browsers that support AudioWorklet.

A note on running against an npm link copy of rollup-plugin-web-worker-loader

rollup-plugin-web-worker-loader has a peerdependency on rollup. However, npm link doesn't resolve peerdependencies by default.

# rather than call rollup as usual
rollup -c rollup.config.js
# you need to invoke node with --preserve-symlinks
node --preserve-symlinks ./node_modules/.bin/rollup -c rollup.config.js

This is only necessary to build with a local version of a package with peerdependencies, and won't be necessary in most AudioWorklet cases.

For more info see this blog post.

rollup-audio-worklet-demo's People

Contributors

hughrawlinson avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

rollup-audio-worklet-demo's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.