{"id":13831924,"url":"https://github.com/waud/waud","last_synced_at":"2025-04-13T07:49:11.026Z","repository":{"id":72060539,"uuid":"47787697","full_name":"waud/waud","owner":"waud","description":"Web Audio Library","archived":false,"fork":false,"pushed_at":"2019-10-10T08:08:02.000Z","size":28885,"stargazers_count":638,"open_issues_count":5,"forks_count":38,"subscribers_count":14,"default_branch":"dev","last_synced_at":"2025-04-13T07:49:05.279Z","etag":null,"topics":["audio-sprites","base64","haxelib","html5-audio","npm-package","web-audio","web-audio-library"],"latest_commit_sha":null,"homepage":"http://www.waudjs.com","language":"Haxe","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/waud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-12-10T21:11:47.000Z","updated_at":"2025-02-09T11:22:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"46d2826e-7455-4ac5-bb8d-cb9fab03d8bc","html_url":"https://github.com/waud/waud","commit_stats":{"total_commits":592,"total_committers":5,"mean_commits":118.4,"dds":0.410472972972973,"last_synced_commit":"2cd08f91e2de9029653634812ff2a04dd3bec29d"},"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waud%2Fwaud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waud%2Fwaud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waud%2Fwaud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waud%2Fwaud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waud","download_url":"https://codeload.github.com/waud/waud/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681494,"owners_count":21144700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio-sprites","base64","haxelib","html5-audio","npm-package","web-audio","web-audio-library"],"created_at":"2024-08-04T10:01:44.590Z","updated_at":"2025-04-13T07:49:10.981Z","avatar_url":"https://github.com/waud.png","language":"Haxe","funding_links":["https://www.patreon.com/adireddy"],"categories":["Haxe"],"sub_categories":[],"readme":"# \u003ca href=\"http://waudjs.com\"\u003e\u003cimg class=\"logo\" width=\"280\" height=\"60\" src=\"http://waud.github.io/images/logo/logo.png\" alt=\"Waud\"/\u003e\u003c/a\u003e\nWeb Audio Library with HTML5 audio fallback.\n\n[![Build Status](https://travis-ci.org/waud/waud.svg?branch=dev)](https://travis-ci.org/waud/waud)\n[![npm version](https://badge.fury.io/js/waud.js.svg)](https://www.npmjs.com/package/waud.js)\n[![Code Climate](https://codeclimate.com/github/waud/waud/badges/gpa.svg)](https://codeclimate.com/github/waud/waud)\n[![Issue Count](https://codeclimate.com/github/waud/waud/badges/issue_count.svg)](https://codeclimate.com/github/waud/waud/issues)\n[![Support Waud on Patreon](http://www.waudjs.com/images/patreon_btn.png)](https://www.patreon.com/adireddy)\n\nWaud is a simple and powerful web audio library that allows you to go beyond HTML5's `\u003caudio\u003e` tag and easily take advantage of [Web Audio API](https://developer.mozilla.org/en-US/docs/Web/API/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.\n\n### Features\n\n- Base64 Pack\n- Audio Sprites\n- iOS Audio Unlock\u003csup\u003e1\u003c/sup\u003e\n- Auto Mute\u003csup\u003e2\u003c/sup\u003e\n- Simple API\n- Zero Dependencies\n\n\u003csup\u003e1\u003c/sup\u003e Automatically unlocks audio on iOS devices on first touch.\n\n\u003csup\u003e2\u003c/sup\u003e Automatically mutes audio when the window is not in focus (switching tab, minimising window, etc).\n\n### Installation\n\nAvailable via npm, cdn and haxelib (for haxe users).\n\n- NPM: [https://www.npmjs.com/package/waud.js](https://www.npmjs.com/package/waud.js)\n- CDN: [https://cdnjs.com/libraries/waud.js](https://cdnjs.com/libraries/waud.js)\n- Haxelib: [http://lib.haxe.org/p/waud](http://lib.haxe.org/p/waud)\n\n[![NPM](https://nodei.co/npm/waud.js.png?downloads=true\u0026downloadRank=true)](https://www.npmjs.com/package/waud.js/)\n\n### [API Documentation](http://waud.github.io/api/)\n\n### Example\n\nExample: \n```js\nvar snd = new WaudSound(\"assets/loop.mp3\", { autoplay: false, loop: true, volume: 0.5, onload: playBgSound });\n```\n\n### Base64 Data URI\n\nWaud supports base64 decoding across all browsers including IE 9 and I recommend using this over audio sprites.\n\nUse [waudbase64](https://github.com/waud/waudbase64) to generate base64 encoded JSON file.\n\n`npm install -g waudbase64`\n\n```js\nvar base64pack = new WaudBase64Pack(\"assets/sounds.json\", _onLoad);\n\nfunction _onLoad(snds) {\n  snds.get(\"assets/beep.mp3\").play();\n}\n```\n\nWaud also supports passing data URI string to `WaudSound`.\n\n```js\n//Note that the data URI used below is a sample string and not a valid sound\nvar base64Snd = new WaudSound(\"data:audio/mpeg;base64,//uQxAAAAAAAAAAAAASW5mbwAAAA8AAABEAABwpgADBwsLDxISF\");\n```\n\n### Audio Sprite\n\nUse [waudsprite](https://github.com/waud/waudsprite) to generate audio sprite.\n\n`npm install -g waudsprite`\n\n```js\nvar audSprite = new WaudSound(\"assets/sprite.json\");\naudSprite.play(\"glass\");\n```\n\n### Live Audio Stream\n\n[Waud Radio](http://www.waudjs.com/radio)\n\nWaud supports live audio streams, but make sure to disable web audio as live streams can only be played through HTML5 Audio.\n\n```js\nvar snd = new WaudSound(\"http://ice-sov.musicradio.com/SmoothUKMP3\", { autoplay:true, webaudio:false });\n````\n\n### Browser Support\n\nTested on all major browsers.\n\n| \u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/39.1.1/safari/safari_32x32.png\" alt=\"Safari\"\u003e | \u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/39.1.1/chrome/chrome_32x32.png\" alt=\"Chrome\"\u003e | \u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/39.1.1/firefox/firefox_32x32.png\" alt=\"Firefox\"\u003e | \u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/39.1.1/edge/edge_32x32.png\" alt=\"Edge\"\u003e | \u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/39.1.1/archive/internet-explorer_9-11/internet-explorer_9-11_32x32.png\" alt=\"IE\"\u003e | \u003cimg src=\"https://cdnjs.cloudflare.com/ajax/libs/browser-logos/39.1.1/opera/opera_32x32.png\" alt=\"Opera\"\u003e |\n|:--:|:--:|:--:|:--:|:--:|:--:|\n| Latest ✓ | Latest ✓ | Latest ✓ | Latest ✓ | 9-11 ✓ | Latest ✓ |\n\nBrowser \u0026 Device Testing provided by:\n\n[![BrowserStack](http://waud.github.io/images/browserstack.png)](https://www.browserstack.com)\n\n### Issues\n\nFound any bug? Please create a new [issue](https://github.com/waud/waud/issues/new).\n\n### Demo\n\n- [JavaScript](http://waud.github.io/sample/js.html)\n- [Haxe](http://waud.github.io/sample/)\n- [Base64](http://waud.github.io/sample/base64.html)\n\n### Usage\n\n```js\n// Initialize Waud. Make sure to call this before loading sounds.\nWaud.init();\n\n// To automatically unlock audio on iOS devices by playing a blank sound.\n// The parameter is a callback function that can be used to start playing sounds like background music.\nWaud.enableTouchUnlock(touchUnlock);\n\n// Use if you want to mute audio when the window is not in focus like switching tabs, minimising window, \n// etc in desktop and pressing home button, getting a call, etc on devices.\nWaud.autoMute();\n\n// Load and play looping background sound with autoPlay and loop set to true.\n// Note that this will not play automatically on iOS devices without touching the screen.\nvar bgSnd = new WaudSound(\"loop.mp3\", {\n    \"autoplay\": true,\n    \"loop\": true\n});\n\n// Touch unlock callback for iOS devices to start playing bgSnd if it's not already playing\nfunction touchUnlock() {\n    if (!bgSnd.isPlaying()) bgSnd.play();\n}\n```\n\n### Sample Rate\n\n- It is recommended to use same **sample rate** for all the audio files. Playing different **sample rate** files can cause issues on some devices.\n- By default, **Waud** uses **44100** sample rate. If your audio files have a different sample rate then specify it using [**`Waud.preferredSampleRate`**](http://waud.github.io/api/classes/Waud.html#property_preferredSampleRate) property.\n\n### Licensing Information\n\n\u003ca rel=\"license\" href=\"http://opensource.org/licenses/MIT\"\u003e\n\u003cimg alt=\"MIT license\" height=\"40\" src=\"http://upload.wikimedia.org/wikipedia/commons/c/c3/License_icon-mit.svg\" /\u003e\u003c/a\u003e\n\nThis content is released under the [MIT](http://opensource.org/licenses/MIT) License.\n\n### Contributor Code of Conduct ###\n\n[Code of Conduct](https://github.com/CoralineAda/contributor_covenant) is adapted from [Contributor Covenant, version 1.4](http://contributor-covenant.org/version/1/4)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaud%2Fwaud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaud%2Fwaud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaud%2Fwaud/lists"}