Questions tagged [soundjs]

A Javascript library that provides a simple API, and powerful features to make working with audio a breeze. Part of the CreateJS suite.

About

The SoundJS library manages the playback of audio on the web. It works via plugins which abstract the actual audio implementation, so playback is possible on any platform without specific knowledge of what mechanisms are necessary to play sounds.

Sample Code

 createjs.Sound.alternateExtensions = ["mp3"];
 createjs.Sound.addEventListener("fileload", createjs.proxy(this.loadHandler, this));
 createjs.Sound.registerSound("path/to/mySound.ogg", "sound");
 function loadHandler(event) {
     // This is fired for each sound that is registered.
     var instance = createjs.Sound.play("sound");  // play using id.  Could also use full sourcepath or event.src.
     instance.addEventListener("complete", createjs.proxy(this.handleComplete, this));
     instance.volume = 0.5;
 }

Resources

Related tags

81 questions
1
vote
0 answers

Support for webM and webA files in soundJs and preloadJs

I would like to ask if preloadJS and soundJS libraries support the use of webM and webA video/audio files, because I am having trouble using them. A sample of my code : //Plugin setup and preload files createjs.Sound.alternateExtensions = ["weba"];…
ktsangop
  • 1,013
  • 2
  • 16
  • 29
1
vote
0 answers

Button to trigger seperate line of code HTML Javascript Soundjs

Okay, basically, I want to create a button that triggers a new javascript function. I want the button to click and stay clicked (then click again to toggle off). My code (without button): function playSound(target) { //Play the sound:…
John Myers
  • 11
  • 2
1
vote
0 answers

SoundJS Cordova and WebAudio differences - caching audio files

So I have a question. When using Sound JS and the WebAudio plugin, whenever I createInstance for the same audio file a second time, there's no second request being made. So createInstance makes a http request for that sound file the first time it…
tehmaestro
  • 1,010
  • 2
  • 11
  • 21
1
vote
1 answer

Qooxdoo sound button on/off doesnt work

I catch button in the code: this.buttons.Sound.addListener("pressed", this.__sound, this); And write function, but then I push button sound off/on they didn't work. __sound: function(){ if (this.buttons.Sound.isEnabled()){ …
Nazar
  • 11
  • 3
1
vote
1 answer

HTML5 game on Android - Audio and Video problems

I have searched high and low for several days for this problem and I just can't figure it out, hopefully someone else has solved this. The problem is simple, I have created a web-based game using mainly createjs, preloadjs, and soundjs. The plan was…
1
vote
2 answers

How to get FlashPro CC HTML5 Canvas exports to work with sound on the iPad/iPhone

I can't get FlashPro CC HTML5 Canvas exports to work with sound on the iPad/iPhone. I reached out on Twitter and got this response: "Timeline plays on click, but sound plays asynchronously on frame2. Fix this using "playEmptySound." Here is the…
tonyteach
  • 11
  • 1
1
vote
3 answers

Leaving a webpage with SoundJS causes Google Chrome to crash

I have a webpage index.php which contains a link to sound.php. On sound.php, sound is played using SoundJS. When I navigate from sound.php to index.php, Google Chrome usually (but not always) displays an error message ("Aw,…
Pida
  • 928
  • 9
  • 32
1
vote
1 answer

Multiple instances of sound (SoundJS)

I'm using SoundJS to manage audio in a html5 game we're building. Simplified: we have a song playing in the background and a voice track playing at the same time. I now would like to use an analyser on the voice track to animate one of the…
daedeloth
  • 71
  • 5
1
vote
0 answers

Using SoundJS with node webkit and local MP3 files

Has anyone used soundjs within a node webkit application using local mp3 files? Can it be done? If so I will keep researching. I have test apps that work through a browser (Chrome) playing my MP3 library with it but I cannot update my local library…
ken205726
  • 21
  • 5
1
vote
1 answer

Unable to play sounds on Android Game Build using Cordova

Please can someone help me- this is driving me crazy!!! I have created a HTML5 project which uses PreloadJS and SoundJS to play some sounds. It works absolutely fine in Chrome but when I push it to Cordova Emulator (Android SDK) or to my Android…
user3805377
  • 27
  • 1
  • 8
1
vote
1 answer

SoundJS: Why can't FireFox play mp3 file?

When I try to play a sound ,that is a mp3, like this: createjs.Sound.registerSound('uploads/songs/test.mp3','song'); It gives me this error in FireFox (Chrome works fine): The buffer passed to decodeAudioData contains an unknown content type Does…
0
votes
0 answers

soundjs play mp3, When playing at a higher speed, the pitch becomes higher

The soundjs plugin is used in the project. When the mp3 is played in fast forward, the pitch becomes higher。 Is it possible to not raise the pitch? demo: https://codesandbox.io/s/fervent-grass-g9j248?file=/index.html
wdydxf
  • 1
  • 2
0
votes
0 answers

Audio plays in all browsers but Safari desktop

I have an issue with Safari desktop. This snippet of code works even on the mobile version of Safari just not on the desktop version (12.1). js var targetBeep = "targetBeep"; var atmos = "atmos"; createjs.Sound.registerSound("targetBeep.mp3",…
ziggelflex
  • 23
  • 4
0
votes
1 answer

SoundJS wont play sound from an extension-less MP3

I'm about ready to chuck this god damn library in the bin. I had no issues with "HowlerJS" when doing this and it seems that SoundJS just refuses to load my mp3 files unless they have an extension. My code is really simple, an array full of file…
lyds
  • 9
  • 2
0
votes
0 answers

Sound effect delayed after first time it's played

I am using the SoundJS library within the CreateJS suite. I use the LoadQueue class to preload all my sounds. I am finding that when I go to play a sound effect for the first time it's delayed by a good half second before it plays. After the…