https://github.com/randomgamingdev/basicsoundjs
A basic web javascript Sound library based off of the Web Audio API that allows for overlapping sounds
https://github.com/randomgamingdev/basicsoundjs
audio browser browser-js easy javascript javascript-library replacement simple sound web web-audio web-audio-api web-audio-library
Last synced: about 2 months ago
JSON representation
A basic web javascript Sound library based off of the Web Audio API that allows for overlapping sounds
- Host: GitHub
- URL: https://github.com/randomgamingdev/basicsoundjs
- Owner: RandomGamingDev
- License: mit
- Created: 2024-07-12T01:03:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-12T01:14:48.000Z (over 1 year ago)
- Last Synced: 2024-07-12T02:40:44.834Z (over 1 year ago)
- Topics: audio, browser, browser-js, easy, javascript, javascript-library, replacement, simple, sound, web, web-audio, web-audio-api, web-audio-library
- Language: JavaScript
- Homepage: https://randomgamingdev.github.io/BasicSoundJs/example
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BasicSoundJs
### A basic web javascript Sound library based off of the Web Audio API that allows for overlapping sounds
#### Here's how you use it:
```js
const sound = new BasicSound();
// Just like the Web Audio API except it allows for sounds to overlap and returns the `Audio` object spawned for playing the Audio
sound.play();
```
#### Advantages
Not only does this library allow for overlapping sounds, but have the same `new ()` and `.play()` API portions (except for minor differences) as the Web Audio API,
but if you're using something like `p5.js-sound` it also presents the advantage of working from `http://`, `https://`, and `file:///`.
For instance, if you want your web app to be able to be ported to android as static files that can just be referenced via a `file:///` URL via `WebView.loadURL()`, p5.js-sound won't work since it attempts to reference a `blob` URL, while this would.
#### Example
An example is available here: https://github.com/RandomGamingDev/BasicSoundJs/tree/main/example
And you can try it out here: https://randomgamingdev.github.io/BasicSoundJs/example
#### How to import
To import this library you can either manually import it by adding the `sound.js` file to your own website or import it via the cdn: https://cdn.jsdelivr.net/gh/RandomGamingDev/BasicSoundJs/sound.js.