Skip to content
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

Allow binding external HRTF implementations #54

Open
ddiakopoulos opened this issue Mar 8, 2017 · 6 comments
Open

Allow binding external HRTF implementations #54

ddiakopoulos opened this issue Mar 8, 2017 · 6 comments
Assignees

Comments

@ddiakopoulos
Copy link
Member

The HRTF implementation in LabSound is well functioning, but large code surface area. Support for ambisonics and other HRTF models would be helpful but require further complexity. Proposal: wrap the audio spatialization features of the Steam Audio SDK into a core node for LabSound, replacing all existing HRTF/HRTFPanner code.

https://github.com/ValveSoftware/steam-audio/releases

The Steam Audio SDK is "openly" licensed, but not OSS. Middleware in the strict sense of the word. It breaks my philosophy not to include binary dependencies in LabSound, but the features might be worth it.

What do you say, @meshula ?

@meshula
Copy link
Member

meshula commented Mar 8, 2017

It wouldn't hurt to factor the HRTF node into an add-on module. Waiting for the HRTF database to load when you're not using it is sub-optimal.

From 10,000 feet, there should probably be a generic interface on spatialization nodes so that various implementations can be dropped in replacably to existing graphs.

@ddiakopoulos
Copy link
Member Author

Hehe, I actually changed it a while ago so a PannerNode loads the database on-demand if one is created by specifying the hrtf search path:

m_hrtfDatabaseLoader = HRTFDatabaseLoader::MakeHRTFLoaderSingleton(sampleRate, stripSlash(searchPath));

@meshula
Copy link
Member

meshula commented Mar 8, 2017

Nice :)

So same as with factoring the HRTF into an add-on, no issue with having Steam Audio SDK as an optional add-on.

I haven't been able to think of a meaningful base class in the last ten minutes, but I still think it's a reasonable idea ;)

@meshula meshula changed the title Support for Steam Audio SDK Optionally use Steam Audio SDK HRTF Apr 18, 2019
@meshula meshula changed the title Optionally use Steam Audio SDK HRTF Allow binding external HRTF implementations Apr 18, 2019
@meshula
Copy link
Member

meshula commented Apr 18, 2019

I think it makes sense to add an additional CustomPanningNode (name?) that allows an external algo, such as the one in the Steam SDK, to be bound by function pointers, subclassing, or lambdas (pick one?). I'd rather leave the existing HRTF in place as it is open, and functional.

@meshula
Copy link
Member

meshula commented Jul 14, 2019

@meshula meshula removed the question label Jul 14, 2019
@meshula
Copy link
Member

meshula commented Feb 5, 2023

@ddiakopoulos The original comment notes that the HRTFPanner has a large code surface. I just did a pass (pushed to main) to consolidate all the scattered objects into a small number of files in order to reduce exposed API. At this point it would be easy to add more spatialization routines, but I would suggest that we keep the standard webaudio one, and simply introduce new models by extending the enumeration with a new PanningModel named Custom, and adding a "set function pointers" function that takes a processing function pointer to invoke, and other utility functions for initialization and so on, basically anywhere we switch on PannerModel we'd have a corresponding function pointer.

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

No branches or pull requests

2 participants