CreateJS / SoundJS

A Javascript library for working with Audio. It provides a consistent API for loading and playing audio on different browsers and devices. Currently supports WebAudio, HTML5 Audio, Cordova / PhoneGap, and a Flash fallback.
http://createjs.com/
MIT License
4.42k stars 838 forks source link

Fix basePath edge-case in registerSound #322

Open porglezomp opened 4 years ago

porglezomp commented 4 years ago

When calling registerSound with an object for src, like for instance when handling a data URL with { src: { mp3: ... }, type: "sound" }, the id would get set as a basePath, and some inconsistent treatment of falsy values would lead to the id getting prepended to the URL. This fixes things so that sounds can be registered with data URLs.

Fixes #120