Paul Hastings
Paul Hastings

Reputation: 11

Preload howler.js sound files with preloadJS

I have a game that uses preloadJS to load the assets. I'm having all kinds of problems with sound on iPads using soundJS but from tests it seems that audio plays fine using howler.js so I'm thinking about using that library for the iPad.

My question is, is the a way to access and play sounds with howler.js that have been preloaded with preloadJS?

Upvotes: 1

Views: 5774

Answers (2)

Sascha
Sascha

Reputation: 1158

Howler 2.0 allows prebuffering by itself. It does it by default, but you may disable it by setting preload to false

var sound = new Howl({
  src: ['sound.mp3'],
  preload: false
});

Upvotes: 5

OJay
OJay

Reputation: 1239

Short answer: Maybe. PreloadJS 0.6.0 is built to be able to independently load audio files, but you would need to figure out how to hand those files off to Howler in a way that it is able to use the results. It would likely be easier to either figure out the issues with SoundJS on iPads (as far as I know everything is working wonderfully with 0.6.0) or preload with Howler.

Hope that helps.

Upvotes: 1

Related Questions