Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support pannerAttr for Howler sounds + improve performance #1788

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

DigiEggz
Copy link

@DigiEggz DigiEggz commented May 23, 2024

Exposes the pannerAttr field, which allows panner values to be set. By setting the panningModel to "equalpower", which results in crisp sound within Howler, resolving the problem mentioned in goldfire/howler.js#112.

The processing performance of "equalpower" is notable compared to HRTF: https://padenot.github.io/web-audio-perf/#pannernode-when-panningmodel--hrtf

In the future, panner attributes can be passed within the HTML5AudioSource play() function, or anywhere after the sound is active. It could also make sense to set a global pannerAttr that is referenced within the init() function.

public function play():Void
{
    …
    id = parent.buffer.__srcHowl.play();

    untyped parent.buffer.__srcHowl._volume = cacheVolume;
    parent.buffer.__srcHowl.pannerAttr({coneInnerAngle: 50, panningModel: "HRTF”});) // An example of passing two new panner attributes
    // setGain (parent.gain);
    …
}

Exposes the pannerAttr field, which allows panner values to be set. By setting the panningModel to "equalpower", audio degradation is prevented and results in crisp by default, resolving the problem mentioned in goldfire/howler.js#112.

In the future, panner attributes can be passed (for example `parent.buffer.__srcHowl.pannerAttr({panningModel: "HRTF”});)` within the HTML5AudioSource `play()` function, after it has began playback via `parent.buffer.__srcHowl.play()`.
@DigiEggz DigiEggz changed the title Support pannerAttr for Howler sounds Support pannerAttr for Howler sounds + prevent degredation May 23, 2024
@DigiEggz DigiEggz changed the title Support pannerAttr for Howler sounds + prevent degredation Support pannerAttr for Howler sounds + improve performance May 24, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant