Audio Error 1 in IE9

Monkey Forums/Monkey Programming/Audio Error 1 in IE9

Farflame(Posted 2012) [#1]
I'm just finishing my game and didn't realise it wasn't working in IE. No probs in Firefox or Chrome, but several errors in IE8 and 9. The one it's throwing up at the moment is just 'Audio Error1' when I'm running HTML5 in IE. It's repeating over and over in a scroll box below my game window and some of the sounds aren't registering. The error is a bit vague - has anyone encountered it or have any idea what might be causing it?

Another thing I'm not sure of. I was getting errors and what appeared to be line numbers in my main program. These line numbers did make sense, the first was the line calling a function, then a line calling another function and then the line number itself. Again, this was only in HTML5 and IE. I tried commenting out the line, but it kept giving the same error. Then I put the line back in, and now it's just running fine. A bit vague, but my question is, are these lines actually pointing directly at my monkey code, or does it mean a line in the compiled code?


muddy_shoes(Posted 2012) [#2]
I'd guess that your audio file doesn't exist in the build or it's an incorrect type for playback in IE.

As for your other errors it would help if you'd post the actual error text rather than an impression of what they were like. Errors popped up in a window from a debug build are usually referring to monkey code lines, other errors may well be referring to javascript lines.


Jesse(Posted 2012) [#3]
when I compile the code for html5 I get that error "Audio Error 1" on safari as well. I have been staying away from html5 lately. Too many inconsistencies.


Farflame(Posted 2012) [#4]
I was only doing a HTML5 build to put it up on the Monkey site, but there are several odd errors which aren't occuring in Flash. The sounds definitely exist in the data folder and are all in OGG format (there are only 7 sounds). It's not playing any sounds at all. The other error just comes and goes, even if I comment out the line. It's no biggie I guess, the Flash version works fine.


muddy_shoes(Posted 2012) [#5]
AFAIK IE doesn't play ogg files. It plays MP3 files.


Farflame(Posted 2012) [#6]
But HTML5 requires OGG right? I use the little 'GetSoundExtension' function written by Mark for the Monkey Audiotest program to work out which target I'm using and that suggests OGG for HTML5. Do I need to do a seperate test for the browser?

I've managed to force the other error by deliberately throwing it a wrong value, and the error is Monkey RunTime Error: DOM Exception: Index_Size_Err(1) and then a bunch of line numbers. The odd thing though is that if I remove the line from the program, it still throws the error.


Jesse(Posted 2012) [#7]
http://www.w3schools.com/html5/html5_audio.asp


Farflame(Posted 2012) [#8]
Well I'm even more confused now, because the code I used (took from the demo Audio Test) says that it's the target, rather than the browser which determines the sound file. And I test on Firefox in Flash, which loads the sounds in as MP3, and it works fine - though that page you linked says Firefox doesn't accept MP3! Which is it, the target or the browser?

It doesn't really matter because I'm only using Flash and MP3's work in every browser I've tested on. It's just... confusing.


Jesse(Posted 2012) [#9]
for html5 its the Browser that sets the limitations. I am surprised that it works in your computer because google says otherwise:
http://www.google.com/search?client=safari&rls=en&q=does+firefox+support+mp3&ie=UTF-8&oe=UTF-8


muddy_shoes(Posted 2012) [#10]
I test on Firefox in Flash, which loads the sounds in as MP3, and it works fine - though that page you linked says Firefox doesn't accept MP3!


The page is about HTML5 audio support. Flash is something else entirely.


Farflame(Posted 2012) [#11]
I get it now, it's because I was relying on the Audiotest function which only tests the target and is telling it to use Ogg for HTML5, but that's not working with IE. I do get sound in HTML5 and Firefox, although there are some problems with sounds just stopping after a while. Also getting graphical glitches which require constant clearing of the cache and quite a few errors.

As you said at the top, HTML5 right now seems a bit inconsistent. My Flash version works fine on all browsers, so I'm sticking with that for now.


tiresius(Posted 2012) [#12]
Hi I find it concerning that IE is the only one that does not accept WAV files for sound. Is there a way in Monkey code to determine browser and load sound files conditionally?