[Log] [lime.Assets] Audio asset "assets/sound/intro.ogg" exists, but only asynchronously (Devmatg.js, line 24963)
[Log] AssetManager.hx:1191: [AssetManager] Adding sound 'intro' (Devmatg.js, line 9284)
getting this error:
TypeError: null is not an object (evaluating 'this.introSound.play')
Really? Am I the only who is experiencing audio problems on HTML5? Spent most of the day yesterday trying to figure this out but I am still unable to figure out why audio only works on neko, mac, windows, but not html.
Then use the id to get the sound, no matter which platform you target.
introSound = Assets.getSound("intro");
I think you will have problems with html5 if you have any mp3 files in your assets and don’t exclude them in project.xml, if I remember. If you do have any mp3s in your assets folder, adding <assets path="assets" if="html5" exclude="*.mp3" /> to `project.xml’ might be all you need.
Hope it helps. Maybe someone with more knowledge can help.
Not using mp3 and I have no plans to target flash. I am only playing one .ogg file at a time. When I check the browser console it says the file is not being loaded. It may be an error on my part but I have not been able to figure out what it is. I have followed different tutorials but all pretty much are the same to an extent.
I figured out my problem. I started using starling and it’s asset manager and now I can successfully load a sound and play it on an HTML5 target. However I innitially encoutered a similar problem with the sound not loaded. The reason my intro.ogg was seemed to be playing was because that was not the sound that was playing at all. I forgot I had also generated an mp3 version of it and that is the file that was actually playing. Once I generated mp3’s for the other files the sound loaded and played successfully.
As of this writing I have tested simply loading openFL asset manager without the starling extended version but I suspet it is the same thing. Since I was able to play the sound with openFL’s Asset class before.