Hashlink version has no sound

Sound works for me in JS but not in HL (both Windows and Linux). I am using ogg files for the release.

I’ve also tried changing mastervolume just in case it was set to 0.0 but nope.

When starting the game speakers make a boop sound. :slight_smile:

Some more details:

  • hxd.res.Sound.supportedFormat(OggVorbis) returns true
  • I am using initEmbed
  • I am loading sounds with var sound = hxd.Res.loader.load(“audio/”+name).toSound() - is that wrong for embed?
  • I play them sound.play() → and that doesn’t crash, just makes no sound

All that works in browser, just not in HL.

1 Like

I’ve solved it by using this: https://github.com/yvanoff/redistHelper version of redistHelper to create the release. Before I was probably missing some library files.

But for me this didn`t help.

Could you describe your exact problem? Is it the same as mine was? No sounds, just boop? How are you using redistHelper? I had to copy some files from the hashlink download to the output directories that tool makes, otherwise the executable was showing error about missing files. But after that both windows and linux versions work - don’t have macos to check that one.

I installed this library and in console wrote “haxelib run redistHelper compile.hxml”.
After I launched exe file sound didn’t worked.
Compile.hxml:
-cp src
-lib format
-lib heaps
-lib hlopenal
-lib hashlink
-lib hlsdl
-hl bin/app.hl
–main Main

Main.hx:
if (hxd.res.Sound.supportedFormat(OggVorbis)) soundRes = hxd.Res.sound.menu;
if (soundRes != null) sound = soundRes.play();

I wrote about my problem in topic 5 days ago - Sound don`t working in Heaps engine