OpenAL extension - 3D audio, pitch, doppler effect and other stuff

No

Yes, I agree. Sound improvements will happen. It’s in our roadmap (we will share a 12 month plan soon).

5 Likes

Thanks! Looking forward to the new roadmap :slight_smile:

1 Like

Regarding a 3D sound dead space, @sergey.lerg, I still didn’t find a proper setting to achieve the desired effect :frowning: maybe you have any idea of what can be done?

1 Like

I think you can put the sound source a few units above the character. That way character will never intersect the source.

2 Likes

And when I’m back to OpenAl, I still have that problem with positioned sound playing either on the left or the right earphone, but never on both (except when the listener go is exactly in the pos.x of the sound source go). Positioning it above ore below, even far away, doesn’t change it, it looks like it checks only x axis and not y axis. Though, relative volume seems to be tuned according to the distance between a source and the listener.

1 Like

Ok, will look into that more carefully.

It was due to incorrect listener orientation. Fixed by

openal.listener.orientation_at_x = 0
openal.listener.orientation_at_y = 0
openal.listener.orientation_at_z = 1

openal.listener.orientation_up_x = 0
openal.listener.orientation_up_y = 0
openal.listener.orientation_up_z = 1

I’ll make that default in the extension.

2 Likes

Fixed in the extension. Now listener has xyz for orientation_at = 0, 0, 1 and orientation_up = 0, 0, 1.

Which results in a nicer transition from channel to channel when moving around a sound source.

2 Likes

Thank you very much! :heavy_heart_exclamation:

1 Like

EXTENSION UPDATE

Fixed glitchy sound on Windows. Now you have to disable Defold’s sound system by using sound_null.appmanifest in game.project file under Native Extensions -> App Manifest.

4 Likes

On HTML5 it’s now required to wait for a user click before playing any sound. Added such delay to the example.

3 Likes

Why is that? :frowning:

To prevent unwanted audio being played to the user.

1 Like

It’s a browser policy I think?

1 Like

Yes.

2 Likes

Hi! Thanks for creating this extension.

Just discovered it and played my first sounds ever :grin:

But I was wondering: how to simply… change the volume of a sound? :thinking: (without moving anything… just increase or reduce the volume)

Hi! Cool!
The volume is the “gain” property of the source object.

Thanks for your answer :slight_smile: indeed it works now (I’m probably lacking of vocabulary but maybe you should mention the word “volume” in the documentation …? for people like me :sweat_smile:)

But I’m encountering an issue:

For some reason, sometimes the sound is played. Then I rebuild and it won’t work for 2-3 builds in a row… And then I re-re-re-build and it works again. And I rebuild and the sound is played repeatedly (instead of once per click). And then it works as intended again. etc.

I don’t where it comes from but it randomly works :frowning: (currently testing with a basic “button click” sound)

Am I the only one to encounter this issue(s)?

It is confusing, but gain is a general term and used in OpenAL, so I had to follow.

It is strange. I haven’t touched the code for a while, maybe there is a bug somewhere, maybe it’s platform dependent. Try building standalone versions and running them several times in a row?

The issue doesn’t occur when I play the same sound in the example project (with the cat etc.), in this case my click sound is “clean”, and played exactly as intended.

So it doesn’t come from the sound, nor the code… but from my project and more precisely how I integrated openAL into it :sweat_smile:

I’ll try to find out what :thinking:

Thank you again for your answer!

1 Like