Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Firefox Error with L's HTML5 Sound Macro

I apologize if this isn't worthy of a new thread. I searched, but couldn't find a similar post.

A new bug has appeared for me when I try to open any of my 1.4.2 stories that use L's HTML5 Sound Macro set in Firefox. To be clear up front, I'm using an .mp3 file, all of the stories use Sugarcane, and all still work as expected in other browsers.

Two major problems are occurring:

1. <<playsound "filename.mp3">> doesn't seem to work, but there's no error. No sound plays at all.
2. <<stopsound "filename.mp3">> causes this error message to appear: [quote]Error executing macro stopsound: InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable
3. Other macros in the set don't seem to cause errors, but it's hard to tell whether they work without playsound working first.

Any ideas what might be causing this or how I might fix it? I'll appreciate any help or advice I can get.

Comments

  • Are you able to upload one of the stories that don't work so it can be used to debug the issue?

    After some testing on Firefox I only get the same <<stopsound>> error if I place that macro within the Start passage, is this what you are doing?
    The error may be due to a timing issue if either Leon's code, or the Audio objects it creates, are still setting up in the background.

  • The error likely comes from trying to set the currentTime parameter while the none of the audio resource has been loaded (i.e. the readyState parameter is in the HTMLAudioElement.HAVE_NOTHING state).  Doing so will throw the InvalidStateError, since trying to seek on an audio resource you don't know the duration of would be undefined behavior.  That's also likely the reason that &lt;&lt;playsound&gt;&gt; isn't working, the system can't play audio it hasn't loaded.

    Since you say that viewing the same file in other browsers works as expected, we can probably rule out a bad path to the audio file.

    What version of Firefox are you using?
  • Thanks for the replies!

    @greyelf: I have not placed the javascript in the Start passage; it has its own dedicated passage. I've attached a small example.

    @The MadExile: I'm using Firefox 35.0.1. I'm fairly certain it's not a path problem, as the files not only play in other browsers, but worked in Firefox until very recently. My (very uneducated) assumption was that this must somehow related to the most recent Firefox update.
Sign In or Register to comment.