• Stars
    star
    1,197
  • Rank 37,704 (Top 0.8 %)
  • Language
    HTML
  • License
    Creative Commons ...
  • Created over 7 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code examples that accompany the MDN Web Docs pages relating to Web Audio.

webaudio-examples

Code examples that accompany the MDN Web Audio documentation.

Serving the examples

To preview the examples, clone the repository and navigate to the example you want to view. For example, if you have Python installed, you can use the following commands to serve the audio-analyser example:

cd audio-analyser
python3 -m http.server

Then navigate to http://localhost:8000 in your browser. For more information on serving files locally using different languages or technologies, see Running a simple local HTTP server.

Repository contents

Audio analyser

The audio-analyser directory contains a very simple example showing a graphical visualization of an audio signal drawn with data taken from an AnalyserNode interface. Run the demo live.

Audio basics

The audio-basics directory contains a fun example showing a retro-style "boombox" that allows audio to be played, stereo-panned, and volume-adjusted. Run the demo live.

Audio buffer

The audio-buffer directory contains a very simple example showing how to use an AudioBuffer interface in the Web Audio API. Run the demo live.

Audio param

The audio-param directory contains some simple examples showing how to use the methods of the Web Audio API AudioParam interface. Run example live.

Audio context states

The audiocontext-states directory contains a simple demo of the new Web Audio API AudioContext methods, including the states property and the close(), resume(), and suspend() methods. Run the demo live.

Audio worklet

The audioworklet directory contains an example showing how to use the AudioWorklet interface. See also the guide on background audio processing using AudioWorklet. Run the example live.

Compressor example

The compressor-example directory contains a simple demo to show usage of the Web Audio API BaseAudioContext.createDynamicsCompressor() method and DynamicsCompressorNode interface. Run the example live.

Create media stream destination

The create-media-stream-destination directory contains a simple example showing how the Web Audio API AudioContext.createMediaStreamDestination() method can be used to output a stream - in this case to a MediaRecorder instance - to output a sinewave to an opus file. Run the demo live.

Decode audio data

The decode-audio-data directory contains a simple example demonstrating usage of the Web Audio API BaseAudioContext.decodeAudioData() method. View example live.

IIR filter node

The iirfilter-node directory contains an example showing usage of an IIRFilterNode interface. Run the demo live.

Media source buffer

The media-source-buffer directory contains a simple example demonstrating usage of the Web Audio API AudioContext.createMediaElementSource() method. View the demo live.

Multi track

The multi-track directory contains an example of connecting separate independently-playable audio tracks to a single AudioDestinationNode interface. Run the example live.

Offline audio context

The offline-audio-context directory contains a simple example to show how a Web Audio API OfflineAudioContext interface can be used to rapidly process/render audio in the background to create a buffer, which can then be used in any way you please. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext. Run example live.

Offline audio context promise

The offline-audio-context-promise directory contains a simple example to show how a Web Audio API OfflineAudioContext interface can be used to rapidly process/render audio in the background to create a buffer, which can then be used in any way you please. Run the example live.

Output timestamp

The output-timestamp directory contains an example of how the AudioContext.getOutputTimestamp() property can be used to log contextTime and performanceTime to the console. Try the demo live.

Panner node

The panner-node directory contains a demo to show basic usage of the Web Audio API BaseAudioContext.createPanner() method to control audio spatialization. Run the example live.

Script processor node

The script-processor-node directory contains a simple demo showing how to use the Web Audio API's ScriptProcessorNode interface to process a loaded audio track, adding a little bit of white noise to each audio sample. See the live demo.

Spatialization

The spatialization directory contains an example of how the various properties of a PannerNode interface can be adjusted to emulate sound in a three-dimensional space. For more information see Web audio spatialization basics. Try the live demo.

Step sequencer

The step-sequencer directory contains a simple step-sequencer that loops and manipulates sounds based on a dial-up modem. For more information see Advanced techniques: creating sound, sequencing, timing, scheduling. See the live demo also.

Stereo panner node

The stereo-panner-node directory contains a simple example to show how the Web Audio API StereoPannerNode interface can be used to pan an audio stream. Run the example live.

Stream source buffer

The stream-source-buffer directory contains a simple example demonstrating usage of the Web Audio API MediaStreamAudioSourceNode object. View example live.

Violent theremin

Violent theremin uses the Web Audio API to generate sound, and HTML5 canvas for a bit of pretty visualization. The colors generated depend on the pitch and gain of the current note, which are themselves dependent on the mouse pointer position.

You can view the demo live here.

Voice-change-O-matic

The voice-change-o-matic directory contains a Web Audio API-powered voice changer and visualizer.

You can view the demo live here.

More Repositories

1

content

The content behind MDN Web Docs
Markdown
8,869
star
2

learning-area

GitHub repo for the MDN Learning Area.
HTML
6,739
star
3

browser-compat-data

This repository contains compatibility data for Web technologies as displayed on MDN
JSON
4,803
star
4

webextensions-examples

Example Firefox add-ons created using the WebExtensions API
JavaScript
3,972
star
5

dom-examples

Code examples that accompany various MDN DOM and Web API documentation pages
JavaScript
3,198
star
6

web-components-examples

A series of web components examples, related to the MDN web components documentation at https://developer.mozilla.org/en-US/docs/Web/Web_Components.
JavaScript
2,975
star
7

serviceworker-cookbook

It's online. It's offline. It's a Service Worker!
JavaScript
2,767
star
8

kuma

The project that powers MDN.
Python
1,932
star
9

translated-content

The source repository of all translated content for MDN Web Docs
Markdown
1,610
star
10

django-locallibrary-tutorial

Local Library website written in Django; example for the MDN server-side development Django module: https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django.
Python
1,535
star
11

web-speech-api

A repository for demos illustrating features of the Web Speech API. See https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API for more details.
JavaScript
1,413
star
12

mdn

Holding repo for MDN Web Docs things
1,263
star
13

webgl-examples

Code examples that accompany the MDN WebGL documentation
JavaScript
1,196
star
14

express-locallibrary-tutorial

Local Library website written in NodeJS/Express; example for the MDN server-side development NodeJS module: https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs.
JavaScript
1,190
star
15

yari

The platform code behind MDN Web Docs
TypeScript
1,145
star
16

js-examples

Code examples that accompany the MDN JavaScript/ECMAScript documentation
JavaScript
1,090
star
17

webassembly-examples

Code examples that accompany the MDN WebAssembly documentation โ€” see https://developer.mozilla.org/en-US/docs/WebAssembly.
WebAssembly
1,087
star
18

samples-server

MDN samples server; used for samples that can't be hosted in-place on MDN, plus back-end server-side code for samples that need it.
JavaScript
953
star
19

pwa-examples

Examples for progressive web apps.
JavaScript
902
star
20

sw-test

Service Worker test repository. This is a very simple demo to show basic service worker features in action.
JavaScript
756
star
21

simple-web-worker

A simple web worker test.
JavaScript
722
star
22

data

This repository contains general data for Web technologies
JavaScript
714
star
23

interactive-examples

Home of the MDN live code editor interactive examples
HTML
708
star
24

voice-change-o-matic

Web Audio API-powered voice changer and visualizer
JavaScript
705
star
25

css-examples

Code examples that accompany the MDN CSS documentation
HTML
582
star
26

fetch-examples

A repository of Fetch examples. See https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API for the corresponding documentation.
HTML
513
star
27

web-dictaphone

A sample MDN app that uses getUserMedia and MediaRecorder API for recording audio snippets, and The Web Audio API for visualizations.
JavaScript
480
star
28

to-do-notifications

Enhanced version of the to-do app, which stores to-do items via IndexedDB, and then also aims to provide notifications when to-do item deadlines are up, via the Notification and Vibration APIs.
JavaScript
383
star
29

curriculum

MDN front-end developer curriculum
Shell
351
star
30

beginner-html-site

A simple one page website created to help complete beginners learn HTML basics.
HTML
284
star
31

beginner-html-site-scripted

A simple one page website created to help complete beginners learn HTML basics. which in this repo has also had some script added to help beginners learn JavaScript basics.
HTML
255
star
32

violent-theremin

Violent theremin uses the Web Audio API to generate sound, and HTML5 canvas for a bit of pretty visualization. The colours generated depend on the pitch and gain of the current note, which are themselves dependant on the mouse pointer position.
JavaScript
239
star
33

todo-react

Sample todo app built with the React/ReactDOM framework.
JavaScript
215
star
34

django-diy-blog

Basic blog site written in Django (part of MDN Django module assessment).
Python
204
star
35

beginner-html-site-styled

A simple one page website created to help complete beginners learn HTML basics, which in this repo has also been styled to help beginners learn CSS basics. The styling is explained over the course of https://developer.mozilla.org/en-US/Learn/Getting_started_with_the_web/CSS_basics.
HTML
204
star
36

simple-shared-worker

A simple demo to show shared worker basics.
HTML
198
star
37

sprints

Archived: MDN Web Docs issues are tracked in the content repository.
150
star
38

canvas-raycaster

Using the <canvas> element to do software rendering of a 3D environment with ray-casting
JavaScript
148
star
39

kumascript

Bringing scripting to the wiki bears.
HTML
130
star
40

mdn-community

A place to provide feedback and suggestions for MDN Web Docs
119
star
41

mdn-minimalist

The base Sass for Mozilla Developer based projects and products
SCSS
110
star
42

todo-vue

Sample todo app built with the Vue framework
Vue
99
star
43

html-examples

Code examples that accompany the MDN HTML documentation: https://developer.mozilla.org/en-US/docs/Web/HTML
HTML
89
star
44

advanced-js-fundamentals-ck

This content kit provides learning material to allow intermediate web developers to level up their skills, learning real world techniques to take them past rudimentary syntax towards a solid foundation of skills than can be utilized to create modern web applications. It'll be visual; you'll have fun along the way.
JavaScript
81
star
45

webvr-tests

A set of simple tests for testing WebVR functionality. See https://developer.mozilla.org/en-US/docs/Web/API/WebVR_API for the latest on the documentation.
JavaScript
76
star
46

bob

Builder of Bits aka The MDN Web Docs interactive examples, example builder
TypeScript
74
star
47

headless-examples

Examples to support the MDN resource covering Firefox headless mode โ€” see https://developer.mozilla.org/en-US/Firefox/Headless_mode
JavaScript
71
star
48

developer-portal

The code that generates the MDN Web Docs Developer Portal.
Python
61
star
49

archived-content

Archived MDN Web Docs content that is not actively maintained or frequently built
HTML
58
star
50

voice-change-o-matic-float-data

Web Audio API-powered voice changer and visualizer
JavaScript
56
star
51

mdn-app-template

[UNMAINTAINED] A simple template for writing web apps into, to save you some time when experimenting. Used in MDN web app demos. See https://developer.mozilla.org/en-US/docs/Web/Apps/App_coding_guidelines#Apps_template for more information on what this template contains.
CSS
55
star
52

markdown

MDN Web Docs tool to covert HTML to Markdown
JavaScript
53
star
53

infra

(Deprecated) MDN Web Docs Infrastructure scripts and configuration
HCL
53
star
54

rumba

The clean kuma (๐Ÿค–๐Ÿงน)
Rust
49
star
55

learning-area-pt-br

The MDN Learning Area code examples translated into Brazilian Portuguese.
HTML
42
star
56

wp-promote-mdn

WordPress plugin automatically links keywords and phrases to MDN.
PHP
35
star
57

crossbrowser-testing-lab

Mozilla's Cross-Browser Testing Lab
32
star
58

battery-quickstart-starter-template

[UNMAINTAINED] The starting state of the example built up in the "Your first app" tutorial found in the Mozilla Developer Network open web app Quickstart article.
CSS
32
star
59

indexeddb-examples

Code examples that accompany the MDN IndexedDB documentation
JavaScript
31
star
60

workflows

Reusable GitHub Actions workflows
29
star
61

houdini-examples

CSS Houdini examples relating to MDN content.
HTML
28
star
62

sphinx-theme

(Deprecated) Make Sphinx docs look like MDN
HTML
28
star
63

pab

MDN Web Docs Product Advisory Board
HTML
26
star
64

ansible-jenkins

(Deprecated) Jenkins ansible playbook
Jinja
26
star
65

mdn.dev-2019

(Deprecated) Content for https://mdn.dev
JavaScript
24
star
66

browser-api-demo

A simple demo to show usage of the Mozilla Browser API. See https://developer.mozilla.org/en-US/docs/Web/API/Using_the_Browser_API for more details.
JavaScript
23
star
67

addon-sdk-content-scripts

DEPRECATED | Use WebExtensions instead | Add-ons demonstrating how to use content scripts in the Add-on SDK.
JavaScript
23
star
68

stumptown-content

JavaScript
22
star
69

browsercompat

API for browser compatibility data on developer.mozilla.org
Python
22
star
70

web-tech-games

Interactive diagram showing what parts of the web technology stack can used for different purposes when creating games. Includes links to more information about each.
HTML
21
star
71

mdn-dinocons

A scalable set of icons for use across Mozilla Developer websites
20
star
72

insights

The repo that powers MDN Web Docs Insights.
HTML
19
star
73

world-clock

An Ember-based app, built as a sample to demonstrate Ember/Ember CLI and modern web architecture. This goes along with the article series found at https://developer.mozilla.org/en-US/Apps/Build/Modern_web_app_architecture.
JavaScript
19
star
74

fibonacci-worker

A web worker that calculates fibonacci numbers.
HTML
18
star
75

content-kit-template

This is the repo to fork or clone when creating a new MDN Content Kit.
HTML
17
star
76

shared-assets

A repository for media and assets to be used across MDN Web Docs
Mermaid
16
star
77

mdn-fiori

MDN Web Docs Front-End style guide
JavaScript
16
star
78

beginning-programming-content-kit

This is a Content Kit for people who want to teach programming to beginners.
HTML
16
star
79

.github

MDN Web Docs public organization profile
13
star
80

repl-panel

This add-on lets you send remote debugging protocol requests to the debugging server, and displays the response.
JavaScript
13
star
81

short-descriptions

Short descriptions of web platform features, for flexible usage in applications.
JavaScript
12
star
82

audio-channels-demo

A demo to show how the AudioChannels API works, at a basic level
JavaScript
12
star
83

mdn-storybook

UI components for MDN Web Docs
JavaScript
12
star
84

perf-examples

Examples related to MDN performance documentation; see https://developer.mozilla.org/en-US/docs/web/Performance
JavaScript
11
star
85

doc-linter-webextension

Webextension to lint MDN documents
JavaScript
10
star
86

webalyzer

[UNMAINTAINED] Collects web code for analysis and reporting.
Python
10
star
87

battery-quickstart-finished-example

[UNMAINTAINED] The finished version of the example built up in the "Your first app" tutorial found in the Mozilla Developer Network open web app Quickstart article.
JavaScript
10
star
88

community-meetings

A place for agendas and minutes from regular MDN community meetings
9
star
89

whitestorm-demo

A simple demo showing usage of the Whitestorm.js 3D web library.
HTML
9
star
90

browser-compat-toolkit

Toolkit for visualizing and editing MDN's browser compatibility data
JavaScript
9
star
91

e10s-example-addons

Examples showing how to port add-ons to be e10s-compatible
JavaScript
9
star
92

viewsourceconf

Repo for View Source Conference site
HTML
8
star
93

museum

A historic collection of MDN Web Docs content and examples
JavaScript
8
star
94

project-template

A project template to use for new MDN GitHub repositories
7
star
95

imsc-examples

Repository for examples to go along with MDN IMSC documentation.
HTML
7
star
96

todo-react-build

Live version of our sample todo app built with the React/ReactDOM framework.
HTML
7
star
97

retired-content

Content previously, but no longer displayed on MDN Web Docs.
HTML
7
star
98

ai-feedback

Feedback about AI Help
7
star
99

doc-linter-rules

Linting rules used to lint MDN Web Documents
JavaScript
6
star
100

helm-charts

DEPRECATED: Kubernetes Helm charts for the Mozilla Developer Network (MDN).
Smarty
5
star