Loading Audio - crossOrigin

Hello,
I’m trying to load audio from a firebase storage url and am struggling bad.
I can load images from the same storage bucket no problem but not audio.
A simple example of what I’ve tried:

var config = {
type: Phaser.AUTO,
parent: 'phaser-example',
width: 800,
height: 600,
pixelArt: true,
scene: {
    preload: preload,
    create: create
}
};

var game = new Phaser.Game(config);

function preload () {
 this.load.audio('a', 'https://firebasestorage.MY_URL');
}

function create () {
 this.sound.play('a');
}

Using audio files in an assets folder works fine. The url can be opened in a browser, so I’m sure that is right. That’s using web audio.
I don’t get a file not found error but there is nothing in the cache when I try to play the sound.
Can anybody point me in the right direction. Should I be trying html audio? Does crossOrigin play a part? Is there a way I can log exactly what’s happening when I try to load the file?
Any input would be great, I’m a bit lost at the moment!

Edit: it might also be worth noting that firestorm urls do not have a filetype extension - is it possible the loader doesn’t know what to do with the url?

Apologies, I can add an extension when uploading files to firebase. This now works as expected. I can’t delete this post but an admin might want to as this issue was not related to phaser.
Sorry :blush:

1 Like