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

Expose full complexity of audio graph in API #76

Open
philpax opened this issue Feb 13, 2023 · 3 comments
Open

Expose full complexity of audio graph in API #76

philpax opened this issue Feb 13, 2023 · 3 comments
Labels
topic:api API functionality, including both host and guest topic:assets Asset loading, streaming, etc

Comments

@philpax
Copy link
Contributor

philpax commented Feb 13, 2023

The basic audio API we'll expose in 0.1 can only play sounds and optionally repeat them. It can't do anything fancy with them, like attenuating them or filtering them or what have you.

However, our host code offers this functionality. We just need to wire this up in both the host and the guest.

@ten3roberts's suggested approach is to use a graph on the guest side (e.g. petgraph) to construct a graph of nodes, serialize these to a list of nodes and edges, and then send them to the host to reconstruct a Source from. This should be doable, I think.

@philpax philpax added topic:api API functionality, including both host and guest topic:assets Asset loading, streaming, etc labels Feb 13, 2023
@philpax
Copy link
Contributor Author

philpax commented Feb 23, 2023

Our basic example should consist of:

  • A camera looking at a cube.
  • The cube moves around with a looping sound attached to it.
  • You can hear the sound moving with the cube.

This example is very similar to the example we have on the host side. Note that we will need to expose the relevant functionality to do this.

@philpax
Copy link
Contributor Author

philpax commented Feb 28, 2023

Just talked about this with @ten3roberts.

Seems pretty doable:

  • Duplicate the host Sources over to the guest
  • Remove all the logic for actually sampling
  • Build a list of corresponding WIT-structure nodes and a list of edges
  • Send over to host
  • Host then builds the corresponding tree of Sources

There's some other stuff we'd have to do around wiring up audio_emitter and audio_listener (can just set up some extra components + systems for this), but this should be doable otherwise.

@chaosprint
Copy link
Contributor

chaosprint commented Apr 13, 2023

We have some basic audio API now: #304

But there are things to consider:

  • API for handling the loading latency

@chaosprint chaosprint removed their assignment Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:api API functionality, including both host and guest topic:assets Asset loading, streaming, etc
Projects
None yet
Development

No branches or pull requests

3 participants