Lerg / extension-openal

MIT License
21 stars 4 forks source link

Sounds playing way too fast/slow #3

Open csklimowski opened 5 years ago

csklimowski commented 5 years ago

When testing this extension on Windows, any sound I try to play just sounds like jittery noise.

I'm using this script to test (this is the only game object):

function init(self)
    local res = resource.load('/assets/sounds/test.wav')
    self.source = openal.new_source(res)
    self.source:play()
end

function update(self, dt)
    print(self.source.time)
end

No errors are reported, and the values printed by print(self.source.time) seem to indicate that the sound is either playing far too fast, or far too slow. Strangely, how fast it plays seems to be non-deterministic; without modifying the code, one test build might play the sound at a tenth the speed it should, and another might play several times faster than it should.

Lerg commented 5 years ago

Something has changed in Windows builds of Defold and now there is this behavior. I'll try looking into what it could be. Most probably some default OpenAL value is of wrong value.

rgrams commented 5 years ago

Huh. I was using an appmanifest from https://britzl.github.io/manifestation/ to strip out the default sound stuff when I started using this extensions (which I had forgotten about), and it worked just fine on Windows. Then it started having errors on HTML5 that it was missing the DefaultSoundDevice, so I changed the appmanifest back to normal, and now on Windows I'm having issues like csklimowski. A bunch of my sounds you can't hear at all, and others are glitchy/way too fast/something.

For now I've edited my appmanifest so it strips out sound on windows but not for web, and everything seems to work okay. It would be nice if this worked out of the box though.