0

I'm building an art piece, and we have a number of interactive elements with sounds and buttons. Some of the sounds are very long running ( forever ), some of the sounds play for only minutes, everything is real-time changeable, all the volumes have to change.

I settled on PulseAudio due to the ability to build mixers, and in C, because C is a language I'm comfortable with.

I've been all through the interfaces over and over. It seems that Sinks have a volume control function, but when one is playing audio, one creates a Stream. Streams don't have a single function, but do have metadata ( which doesn't seem to have volume ). There is a function to get a sink id from a playing stream, but the number is simply an increasing number - there are not Sinks with those IDs, and trying to change volume using that ID simply doesn't work.

You can set the volume when you first start playing a stream.

You can set the volume of a sink, but I have multiple streams playing into a sink - changing that volume changes everything.

At this point, I think I'm adding some kind of "dummy sink", but I just can't believe that a system this rich in functionality won't do what I'm thinking of. Basically, I want a mixer with a lot of channels, and the ability to change the volume of a single track as it's playing, with multiple tracks muxing in.

Love to have any leads on the topic.

Brian Bulkowski
  • 866
  • 1
  • 7
  • 10

1 Answers1

0

Ok!

If you have a stream, and you get the id using pa_stream_get_index(), you get a "sink input id".

Those can be used in pa_context_set_sink_input_volume().

Brian Bulkowski
  • 866
  • 1
  • 7
  • 10