diff --git a/.gitignore b/.gitignore index 496ee2ca..14eedf8d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,22 @@ -.DS_Store \ No newline at end of file +.DS_Store +build/output/ +build/tmp/ +*TMP* +node_modules/ +spikes/ +.idea/ +*.sublime-project +*.sublime-workspace +config.local.json +docs/**/ + +#----------------------------- +# INVALID FILES +# (for cross OS compatibility) +#----------------------------- +*[\<\>\:\"\/\\\|\?\*]* +**/.sass-cache/ +main.css +*.codekit +tests/.grunt +_SpecRunner.html diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..41a9ccc6 --- /dev/null +++ b/.npmignore @@ -0,0 +1,14 @@ +_assets +build +bower.json +dev +docs +examples +extras +icon.png +lib/**-NEXT**.js +spikes +src +tests +tutorials +VERSIONS.txt \ No newline at end of file diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..4ca50b6c --- /dev/null +++ b/ISSUE_TEMPLATE.md @@ -0,0 +1,27 @@ +### TODO +- [ ] Is this a question or bug? [Stack Overflow](https://stackoverflow.com/questions/tagged/createjs) is a much better place to ask any questions you may have. + +- [ ] Did you search the [issues](https://github.com/CreateJS/SoundJS/issues) to see if someone else has already reported your issue? If yes, please add more details if you have any! + +- [ ] If you're using an older [version](https://github.com/CreateJS/SoundJS/blob/master/VERSIONS.txt), have you tried the latest? + +- [ ] If you're requesting a new feature; provide as many details as you can. Why do you want this feature? Do you have ideas for how this feature should be implemented? Pseudocode is always welcome! + + +### Issue Details +* Version used (Ex; 1.0): + + +* Describe whats happening (Include any relevant console errors, a [Gist](https://gist.github.com/) is preferred for longer errors): + + + +* OS & Browser version *(Please be specific)* (Ex; Windows 10 Home, Chrome 62.0.3202.94): + + + +* Do you know of any workarounds? + + + +* Provide any extra details that will help us fix your issue. Including a link to a [CodePen.io](https://codepen.io) or [JSFiddle.net](https://jsfiddle.net) example that shows the issue in isolation will greatly increase the chance of getting a quick response. diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 00000000..268787f6 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 gskinner.com, inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 61b983b1..61aa4eb5 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,21 @@ SoundJS is a library to make working with audio on the web easier. It provides a consistent API for playing audio in different browsers, including using a target plugin model to provide an easy way to provide additional audio plugins -like Web Audio, and a Flash fallback. A mechanism has been provided for easily tying in audio preloading to -[PreloadJS](http://preloadjs.com) +like a Flash fallback (included, but must be used separately from the combined/minified version). + +A mechanism has been provided for easily tying in audio preloading to [PreloadJS](http://createjs.com/preloadjs/). ## Example - createjs.Sound.addEventListener("loadcomplete", handleLoadComplete); - createjs.Sound.registerSound({src:"path/to/sound.mp3|path/to/sound.ogg", id:"sound"}); - function handleLoadComplete(event) { - createjs.Sound.play("sound"); - } +```javascript +createjs.Sound.on("fileload", handleLoadComplete); +createjs.Sound.alternateExtensions = ["mp3"]; +createjs.Sound.registerSound({src:"path/to/sound.ogg", id:"sound"}); +function handleLoadComplete(event) { + createjs.Sound.play("sound"); +} +``` ## License Built by gskinner.com, and released for free under the MIT license, which means you can use it for almost any purpose @@ -21,35 +25,40 @@ Built by gskinner.com, and released for free under the MIT license, which means ## Support and Resources * Find examples and more information at the [SoundJS web site](http://soundjs.com/) -* Read the [documentation](http://createjs.com/Docs/SoundJS/) -* You can also ask questions and interact with other users at our [Community](http://community.createjs.com) site. +* Read the [documentation](http://createjs.com/docs/soundjs/) +* Discuss, share projects, and interact with other users on [reddit](http://www.reddit.com/r/createjs/). +* Ask technical questions on [Stack Overflow](http://stackoverflow.com/questions/tagged/soundjs). +* File verified bugs or formal feature requests using Issues on [GitHub](https://github.com/CreateJS/SoundJS/issues). * Have a look at the included [examples](https://github.com/CreateJS/SoundJS/tree/master/examples) and -[API documentation](http://createjs.com/Docs/SoundJS/) for more in-depth information. +[API documentation](http://createjs.com/docs/soundjs/) for more in-depth information. ## Classes ### [Sound](http://createjs.com/Docs/SoundJS/classes/Sound.html) -The core API for playing sounds. Simply call Sound.play(sound, ...options), and a sound instance is created that can be +The core API for playing sounds. Call createjs.Sound.play(sound, ...options), and a sound instance is created that can be used to control the audio, and dispatches events when it is complete, loops, or is interrupted. -### [SoundInstance](http://createjs.com/Docs/SoundJS/classes/SoundInstance.html) +### [SoundInstance](http://createjs.com/Docs/SoundJS/classes/AbstractSoundInstance.html) A controllable sound object that wraps the actual plugin implementation, providing a consistent API for audio playback, -no matter what happens in the background. Sound instances can be paused, muted, and stopped, and the volume, pan (where -available), and position using the simple API. +no matter what happens in the background. Sound instances can be paused, muted, and stopped; and the volume, pan (where +available), and position changed using the simple API. ### [WebAudioPlugin](http://createjs.com/Docs/SoundJS/classes/WebAudioPlugin.html) -The default, built-in plugin, which uses Web Audio APIs to playback sounds. This is currently only available in Chrome -on OSX and Windows, and iOS 6+. Note that WebAudio will fail to load when run locally, and the HTML audio plugin will -be used instead. +The default, built-in plugin, which uses Web Audio APIs to playback sounds. Note that WebAudio will fail to load when +run locally, and the HTML audio plugin will be used instead. ### [HTMLAudioPlugin](http://createjs.com/Docs/SoundJS/classes/HTMLAudioPlugin.html) The fallback built-in plugin, which manages audio playback via the HTML5