Jump to content

Playing .m4a files


jonwiesman
 Share

Recommended Posts

Hi, I'm trying to play a simple .m4a file when the user collides with an object.

I create it like this:

game.load.audio("dot0", "sounds/dot0.m4a");
 
sfxDot = game.add.audio("dot0");
 

Then later, try to play it like this:

sfxDot.play();

But I get the following error:

Cannot read property 'createBufferSource' of null
    at c.Sound.play (phaser.min.js:3)
    at Object.collectDot (

The sfxDot object seems like a valid sound, from the F12 console:

c.Sound {game: c.Game, name: "dot0", key: "dot0", loop: false, markers: {…}, …

 

I'm sure I'm doing something stupid, this is my first attempt to get a sound to play so I'm probably just missing out on a setup call or something. Also, I'm not even sure that .m4a files are supported, but they were listed in the docs. I looked through the audio samples but couldn't really find a sample that wanted to do exactly what I'm doing here (open a .m4a and play it.)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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