All Projects → waud → Waud

waud / Waud

Licence: mit
Web Audio Library

Programming Languages

haxe
709 projects

Projects that are alternatives of or similar to Waud

I dropped my phone the screen cracked
web audio, cracked.
Stars: ✭ 245 (-61.54%)
Mutual labels:  web-audio, html5-audio
Cracked
Mac app for noise making - built w/ "I Dropped My Phone The Screen Cracked"
Stars: ✭ 98 (-84.62%)
Mutual labels:  web-audio, html5-audio
Amplitudejs
AmplitudeJS: Open Source HTML5 Web Audio Library. Design your web audio player, the way you want. No dependencies required.
Stars: ✭ 3,781 (+493.56%)
Mutual labels:  web-audio, html5-audio
Audiomotion.js
High-resolution real-time spectrum analyzer and music player using Web Audio and Canvas APIs.
Stars: ✭ 177 (-72.21%)
Mutual labels:  web-audio, html5-audio
Howler.js
Javascript audio library for the modern web.
Stars: ✭ 19,425 (+2949.45%)
Mutual labels:  web-audio, html5-audio
Vanilla Framework
From community websites to web applications, this CSS framework will help you achieve a consistent look and feel.
Stars: ✭ 476 (-25.27%)
Mutual labels:  npm-package
Command Line Args
A mature, feature-complete library to parse command-line options.
Stars: ✭ 525 (-17.58%)
Mutual labels:  npm-package
Tfjs Yolo Tiny
In-Browser Object Detection using Tiny YOLO on Tensorflow.js
Stars: ✭ 465 (-27%)
Mutual labels:  npm-package
Electron Better Ipc
Simplified IPC communication for Electron apps
Stars: ✭ 463 (-27.32%)
Mutual labels:  npm-package
Scientist.js
🔬 A JavaScript interpretation of the Ruby library Scientist, a library for carefully refactoring critical paths.
Stars: ✭ 600 (-5.81%)
Mutual labels:  npm-package
Node Tensorflow
Node.js + TensorFlow
Stars: ✭ 581 (-8.79%)
Mutual labels:  npm-package
Synp
Convert yarn.lock to package-lock.json and vice versa
Stars: ✭ 510 (-19.94%)
Mutual labels:  npm-package
Angular Translate
Translating your AngularJS 1.x apps
Stars: ✭ 4,414 (+592.94%)
Mutual labels:  npm-package
Capture Website Cli
Capture screenshots of websites from the command-line
Stars: ✭ 545 (-14.44%)
Mutual labels:  npm-package
Ignite Ui
Ignite UI by Infragistics
Stars: ✭ 468 (-26.53%)
Mutual labels:  npm-package
Pretty Ms
Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s`
Stars: ✭ 599 (-5.97%)
Mutual labels:  npm-package
Electron Reloader
Simple auto-reloading for Electron apps during development
Stars: ✭ 463 (-27.32%)
Mutual labels:  npm-package
Crypto Hash
Tiny hashing module that uses the native crypto API in Node.js and the browser
Stars: ✭ 501 (-21.35%)
Mutual labels:  npm-package
Io 808
An attempt at a fully recreated web-based TR-808 drum machine.
Stars: ✭ 576 (-9.58%)
Mutual labels:  web-audio
Securitydriven.inferno
✅ .NET crypto done right. Professionally audited.
Stars: ✭ 501 (-21.35%)
Mutual labels:  base64

Waud

Web Audio Library with HTML5 audio fallback.

Build Status npm version Code Climate Issue Count Support Waud on Patreon

Waud is a simple and powerful web audio library that allows you to go beyond HTML5's <audio> tag and easily take advantage of Web Audio API. It abstracts Web Audio API making it consistent and reliable across multiple platforms and browsers. It also falls back to HTML5 Audio on non-modern browsers where Web Audio API is not supported.

Features

  • Base64 Pack
  • Audio Sprites
  • iOS Audio Unlock1
  • Auto Mute2
  • Simple API
  • Zero Dependencies

1 Automatically unlocks audio on iOS devices on first touch.

2 Automatically mutes audio when the window is not in focus (switching tab, minimising window, etc).

Installation

Available via npm, cdn and haxelib (for haxe users).

NPM

API Documentation

Example

Example:

var snd = new WaudSound("assets/loop.mp3", { autoplay: false, loop: true, volume: 0.5, onload: playBgSound });

Base64 Data URI

Waud supports base64 decoding across all browsers including IE 9 and I recommend using this over audio sprites.

Use waudbase64 to generate base64 encoded JSON file.

npm install -g waudbase64

var base64pack = new WaudBase64Pack("assets/sounds.json", _onLoad);

function _onLoad(snds) {
  snds.get("assets/beep.mp3").play();
}

Waud also supports passing data URI string to WaudSound.

//Note that the data URI used below is a sample string and not a valid sound
var base64Snd = new WaudSound("data:audio/mpeg;base64,//uQxAAAAAAAAAAAAASW5mbwAAAA8AAABEAABwpgADBwsLDxISF");

Audio Sprite

Use waudsprite to generate audio sprite.

npm install -g waudsprite

var audSprite = new WaudSound("assets/sprite.json");
audSprite.play("glass");

Live Audio Stream

Waud Radio

Waud supports live audio streams, but make sure to disable web audio as live streams can only be played through HTML5 Audio.

var snd = new WaudSound("http://ice-sov.musicradio.com/SmoothUKMP3", { autoplay:true, webaudio:false });

Browser Support

Tested on all major browsers.

Safari Chrome Firefox Edge IE Opera
Latest ✓ Latest ✓ Latest ✓ Latest ✓ 9-11 ✓ Latest ✓

Browser & Device Testing provided by:

BrowserStack

Issues

Found any bug? Please create a new issue.

Demo

Usage

// Initialize Waud. Make sure to call this before loading sounds.
Waud.init();

// To automatically unlock audio on iOS devices by playing a blank sound.
// The parameter is a callback function that can be used to start playing sounds like background music.
Waud.enableTouchUnlock(touchUnlock);

// Use if you want to mute audio when the window is not in focus like switching tabs, minimising window, 
// etc in desktop and pressing home button, getting a call, etc on devices.
Waud.autoMute();

// Load and play looping background sound with autoPlay and loop set to true.
// Note that this will not play automatically on iOS devices without touching the screen.
var bgSnd = new WaudSound("loop.mp3", {
    "autoplay": true,
    "loop": true
});

// Touch unlock callback for iOS devices to start playing bgSnd if it's not already playing
function touchUnlock() {
    if (!bgSnd.isPlaying()) bgSnd.play();
}

Sample Rate

  • It is recommended to use same sample rate for all the audio files. Playing different sample rate files can cause issues on some devices.
  • By default, Waud uses 44100 sample rate. If your audio files have a different sample rate then specify it using Waud.preferredSampleRate property.

Licensing Information

MIT license

This content is released under the MIT License.

Contributor Code of Conduct

Code of Conduct is adapted from Contributor Covenant, version 1.4

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].