Bug Issue: Muffled Sounds On HTML5


Pages: 1 2

RosalinaGalaxer

  • Level 3 Stencyler
March 05, 2019, 01:15:47 pm
When testing on HTML5, all sounds (Music and Sound Effects) are muffled and get random pops. This is not the case on Flash. I haven't tested any other platforms as of yet.


rob1221

  • Master Stencyler
  • *
March 07, 2019, 05:43:20 am
This isn't something I've noticed before.  Does this happen on every sound file, including those created from different sources?  Also is this web HTML5 or mobile?
  • Status changed from New to Need Info


RosalinaGalaxer

  • Level 3 Stencyler
March 07, 2019, 12:01:07 pm
This happens on every sound file, with multiple different export options and from multiple sources. I have not tested mobile HTML5: this is all on web HTML5.

I think it's also worth mentioning that (on HTML5) you need to cause a second sound effect to play to get your looping music playing, even if the music is started in a scene "when created" event.


irock

  • Master Stencyler
  • *
March 07, 2019, 07:13:23 pm
I've noticed this as well on HTML5, tested in both Firefox and Safari on Mac. The sound files in the assets folder for the built game sound fine, but it sounds really low quality when played in engine.


rob1221

  • Master Stencyler
  • *
March 08, 2019, 07:11:56 am
I tested one of my games on Flash/HTML5 (Firefox on Windows) but I'm not hearing any audio problems and I'm also not getting the initial sound looping problem.


RosalinaGalaxer

  • Level 3 Stencyler
March 08, 2019, 02:15:46 pm
Very strange.

Here's how everything should sound: https://www.newgrounds.com/dump/item/cdfe604604423def9486eaab36d3d767

And here's how it sounds on HTML5: https://www.newgrounds.com/projects/games/1309603/preview

Please tell me I'm not crazy, and it breaks on your end too.


rob1221

  • Master Stencyler
  • *
March 08, 2019, 03:10:34 pm
Yeah I hear the difference there.  I have no idea what would cause it though.
  • Status changed from Need Info to New


RosalinaGalaxer

  • Level 3 Stencyler
March 12, 2019, 12:59:55 pm
So is there anything I can do to help figure out what's wrong?


rob1221

  • Master Stencyler
  • *
March 12, 2019, 01:17:45 pm
Unless the problem is specific to certain files, I'm not sure what can be done other than wait for OpenFL (or their HTML5 audio library Howler) to fix the problem.


RosalinaGalaxer

  • Level 3 Stencyler
March 29, 2019, 05:10:46 pm
A small update: none of these issues exist when testing on Windows. I'm not sure if that means we can do anything about it, though. Does the Windows end of Stencyl run on OpenFL?


rob1221

  • Master Stencyler
  • *
March 29, 2019, 06:05:50 pm
Yeah it does.


RosalinaGalaxer

  • Level 3 Stencyler
March 29, 2019, 10:06:06 pm
Are sounds set up differently on OpenFL for Windows and HTML5? If they're the same, then it might actually be a problem on our side...


rob1221

  • Master Stencyler
  • *
March 30, 2019, 04:19:46 am
They are different.  Howler is only for HTML5.  I'm guessing the problem is there, although it's possible the problem could be in OpenFL's code.
https://github.com/goldfire/howler.js


RosalinaGalaxer

  • Level 3 Stencyler
March 30, 2019, 09:19:19 am
Is it possible to edit Howler? I found this: https://github.com/goldfire/howler.js/issues/112 but I'm not sure where I'd go to implement it.


rob1221

  • Master Stencyler
  • *
March 30, 2019, 10:18:02 am
The only file I found is plaf/haxe/lib/lime/lime/dependencies/howler.min.js which seems to be a really compressed version of the source so I don't know how you'd go about editing it.


RosalinaGalaxer

  • Level 3 Stencyler
April 05, 2019, 12:58:38 pm
So I tested on Internet Explorer and Microsoft Edge. Neither had audio issues. Chrome seems to be the only browser that gets muffled audio.

I also found out that Chrome has a weird policy that won't allow an HTML5 object to play sound until the user interacts with said HTML5 object. So I just needed to set up a scene that gets the player to click on the screen before any sounds are played.

However, I want this game to run on Chrome because other than this audio problem, Chrome runs the game like a dream compared to IE or ME.
« Last Edit: April 05, 2019, 12:59:02 pm by RosalinaGalaxer »


Justin

  • Master Stencyler
  • *
June 27, 2019, 05:42:47 pm
We can't do anything about Chrome's policy about not playing audio until user input is detected, unfortunately.

The howler issue you referenced is quite old, and any fixes that may have been made there have likely been picked up by OpenFL quite some time ago.

Between 4.0.1 (assuming you're on that build) and the latest private builds, Howler was updated from 2.1.0 to 2.1.1, so maybe something in that update improved this. You can try it out once we release the next public build.
  • Status changed from New to Assigned
  • Issue Assigned from (none) to Justin


Justin

  • Master Stencyler
  • *
July 23, 2020, 08:25:06 pm
Looks like this is still an issue in 4.0.2.

http://community.stencyl.com/index.php/topic,60906.0.html


Justin

  • Master Stencyler
  • *
July 23, 2020, 11:27:24 pm
It seems that the muffled sound can be significantly reduced (or eliminated? I'm not sure) by commenting out a line.

Stencyl/plaf/haxe/lib/lime/lime/src/lime/_internal/backend/html5/HTML5AudioSource.hx

Line 227:
Code: [Select]
if (parent.buffer.__srcHowl != null && parent.buffer.__srcHowl.pos != null) parent.buffer.__srcHowl.pos(position.x, position.y, position.z, id);
« Last Edit: July 23, 2020, 11:28:16 pm by Justin »


NPTP

  • Junior Stencyler
July 26, 2020, 10:09:21 am
It seems that the muffled sound can be significantly reduced (or eliminated? I'm not sure) by commenting out a line.

Thanks! I did so and it appears to un-muffle things in Chrome. I haven't found any issues introduced by this change yet, so hopefully that's a good interim fix.


Justin

  • Master Stencyler
  • *
July 26, 2020, 10:10:31 pm
Well, it makes it impossible to spatialize sound on HTML5. I don't understand why it's a problem though. I assume that there should be a way to hear the sound crisply even if spatialization is used, and that the various default settings applied by howler.js/lime/openfl are getting in the way of that.

As it is, spatialization is enabled by default for all sounds, even though most of the time people don't really care about that (and we don't even have blocks for that in Stencyl. The most we provide is blocks for left/right panning, which doesn't require full-on HRTF spatialization). Since HRTF is more expensive for the CPU, I think a good first step is to not enable spatialization until explicitly set by the user. There's still a problem with the sound being muffled with the default settings, but we can figure that out later.


Pages: 1 2

Details

  • Reported
    March 05, 2019, 01:15:47 pm
  • Updated
    December 11, 2020, 09:38:06 am

  • View Status
    Public
  • Type
    Bug
  • Status
    Resolved
  • Priority
    Normal
  • Version
    Stencyl 3.5
  • Fixed in
    (none)
  • Assigned to
    Justin
  • Category
    Sound Editor

Tags