rezoner / playground

Playground.js is a framework for your javascript based games. It gives you out-of-box access to essentials like mouse, keyboard, sound and well designed architecture that you can expand to your needs.
MIT License
459 stars 50 forks source link

Audio can play event keeps pausing sound on play #51

Open karneaud opened 7 years ago

karneaud commented 7 years ago

When I load a sound in the application object

forceAudioFallback: true,
create() {
    /* things to preload */
    this.loadImage("rejects","orientation")
    this.loadSound("UR-FullExtreme-Voice")
    this.loadData("cuepoints")
  },

then play the audio file in a state

create(){
  this.app.music.play('UR-FullExtreme-Voice', 0)
    console.log('playing');
  },

The audio does not play

it seems that https://github.com/rezoner/playground/blob/master/src/SoundAudio.js#L55

pauses the audio file

maybe you should remove the listener after use for loading.

rezoner commented 7 years ago

I think the audio engine should be replaced - and

I am using this one as it doesn't require to preload sounds before playing them http://playgroundjs.com/libs/sound-on-demand

karneaud commented 7 years ago

I need to create audio cue points/ annotation at certain time in the song currentTime position. I'm was hoping Audio Api would be a bit more useful.