Re:C++ audio mixing library design
by qalmakka on Monday October 17, 2022 @08:30AM
(#33232607)
Am I mistaken, or isn't this very close to what GStreamer already does with sinks and sources?
[ Parent
| on HN ]
It pretty much may be!
Re:C++ audio mixing library design
by tonyarkles on Monday October 17, 2022 @10:33AM
(#33234034)
Yeah, very similar model for sure. I say this having used GStreamer in anger though: the complexity of Glib and GObject makes OP’s API quite a bit nicer to use. There are tradeoffs though; while GStreamer is complex and error-prone, it does have two big pieces that OP’s approach doesn’t:
- metadata in the streams. GStreamer streams have rich data attached to them that allows both sides of the chain to automatically negotiate the specific format and properties of the data in the stream.
- introspection. Given an opaque/genetic GObject pointer to an element in the processing graph, you can query its configuration and sources/sinks without knowing what the object is up front. This ultimately can allow you to walk the entire graph if you want and inspect all of the elements.
> the complexity of Glib and GObject makes OP’s API quite a bit nicer to use
Yeah, Glib and GObject are a massive PITA, thankfully both have C++ bindings and can be used from Vala, so it's not that bad in practice. The C API is a nightmare though.