Jump to content

Problems playing audio


isfuturebright
 Share

Recommended Posts

OK so I've been having a lot of problems with audio recently. My target platform is Samsung Smart TV 2013, which I was able to identify the browser as "Running on Safari an unknown version on Linux". So what happens is, it only plays the first sound I load.

 

I had a music running on the background and was going to add some sounds, but the sounds never played. I thought that maybe it was something wrong with the file types but it wasn't. It runs as it should on Chrome but on the TV it only plays the first loaded audio on my preloader. 

 

I tried adding the following to my preloader's update:

if (this.cache.isSoundDecoded('key'))//sound{      if (this.cache.isSoundDecoded('boden'))//music      {          console.log("Channels: " + game.sound.channels);          console.log("NoAudio: " + game.sound.noAudio);          this.game.state.start('MenuScreen');     }}

When running on chrome after my preloader finishes I can see it waiting a bit before going to my main menu. On the TV it just goes straight to the menu with no wait.

 

I know it's a weird issue, kinda like the Webgl no working one, but if anyone has a clue, please share it :D

Link to comment
Share on other sites

Ok but when I play the music, after the audio, shouldn't it like override it? Or the right behavior is to just not play anything because there's and audio before.

 

Oh and rich I remember I was able to play a sound during the music when I was rendering with CANVAS, does that make any sense? Though the music kinda stuttered while the sound played.

Link to comment
Share on other sites

I got it two work having two songs together, but I'm having problems setting it up when the sound effect is really small. Like I have one that it's less then a second. Again it works fine on Chrome but on the TV it kinds lags to play and sometimes it starts playing one of the songs after it finishes. 

Link to comment
Share on other sites

The slower the device, the longer the gap you need between each sound in the audio sprite. For example on really crappy devices even if the effect only lasts for say 200ms I would still give it 1000ms or more time to play. You should also have padding at the start and end of the mp3 too (at least 2 seconds of silence either end). It's the only way to ensure the device has caught up enough to know to stop the audio, jump to a new marker, etc.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...