Skip to content

Support pannerAttr for Howler sounds + improve performance#1788

Closed
DigiEggz wants to merge 2 commits into
openfl:developfrom
DigiEggz:support-pannerAttr
Closed

Support pannerAttr for Howler sounds + improve performance#1788
DigiEggz wants to merge 2 commits into
openfl:developfrom
DigiEggz:support-pannerAttr

Conversation

@DigiEggz
Copy link
Copy Markdown
Contributor

@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
joshtynjala pushed a commit that referenced this pull request Feb 24, 2025
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()`.
@joshtynjala
Copy link
Copy Markdown
Member

Merged into 8.3.0-Dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants