-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.6.0: AudioChannel.Speed has no effect #1503
Comments
Probably related issue there is icculus/mojoAL#2 |
For the future reference, mentioned in that issue, people in another project added their own pitch impl to their copy of mojoal: |
On the other hand, it might be that OpenAL's "pitch" by concept is not a direct equivalent to the playback speed. |
MojoAL now has a pitch implementation. :) |
Aha. Commit for the reference: icculus/mojoAL@47b22d0 EDIT: from the description it seems like this is not an equivalent to Speed though. I will have to test how it works. |
So, I tried it out, and mojoAL's Pitch is not what we need for Speed, it's a separate kind feature. As mentioned in the commit description, setting pitch only adjusts the sound samples, but it does not change the sound duration. When reading OpenAL specification though, here what it states, in a paragraph for AL_SEC_OFFSET:
Unfortunately, the paragraph for AL_PITCH itself does not mention anything about this. |
As mentioned by @ericoporto elsewhere one may e.g. pass different frequency into the |
I made an experiment with resampler, which changes frequency before passing to OpenAl. So OpenAl thinks that the frequency is same, and sound ends up playing slower and faster; result matches the one of 3.5.1 from what I mat tell. There are couple of issues with this, first the resampling is done per chunk, so there may be lags in speed change. Also position calculation is based on what openal returns, and so far not precise. |
In 3.6.0 setting playback speed in script (using AudioChannel.Speed property) has no effect whatsoever.
The script channel's speed value is being set correctly, which in turn sets OpenAL's source AL_PITCH param.
But apparent problem is that mojoAL is missing pitch implementation completely. It has it applied to a data structure, but I found no code that would use this value.
The text was updated successfully, but these errors were encountered: