Confused about Mixer output #2336
Unanswered
bjoerngiesler
asked this question in
Q&A
Replies: 1 comment 4 replies
-
|
It is pretty diffcult to understand what you are doing if you omitt the variable definitions. If some code paths are crashing, analyse the backtrace: this will give you the root cause! In general, I recommend to build the processing chain with the help of the constructors: this is easier to read and makes sure that the relevant output is define before you call begin. Here is an example that is pretty close with what you are trying to implement.... ps. Instead of using a separate Volume for each GeneratedSoundStream, you could try to use the amplitude of the generator or just adjust the weights in the mixer: This should be more efficient |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to hook a mixer up to a volume stream. The final application I have in mind is something that mixes several sound sources (an audio file player, a signal generator, and others) into one output, and that output getting a final "master" level control. However I'm not clear on how to do this. Here's (part of) my code:
In the first bit, I thought the same semantics that apply for the relation between
sigGenStream_andsigGenVolume_might apply also for the relation betweenmixer_andmixerVolume_, somixerVolume_.setStream()might be the right way. This however dumps core. The second bit doesn't dump core, and it's in line with the Mixer examples (where the output stream is given to the mixer's constructor, mirrored here bymixer_.setOutput(). But this makes the VolumeStream log a null pointer exception as a warning. Looking into the code, that is caused byp_inpbeingnullptr. But setting it to the mixer usingsetStreamcauses the same coredump as in the first block above. What to do?Edit: Since OutputMixer is not a Stream but a Print, I can't use a StreamCopy to copy from it to the
mixerVolume_either. TBH I find this all rather confusing...Edit once more: Should I be using an InputMixer instead? With that, it seems to work.
Beta Was this translation helpful? Give feedback.
All reactions