Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I make portAudio play two tones at the same time without distortion?

distortion play portaudio time
0
Posted

How do I make portAudio play two tones at the same time without distortion?

0

Create just one PortAudio stream. Then in the audio callback function, simply mix the two tones together by adding their samples. You will need to scale their amplitudes down so that they do not clip. In this example I generate two waveforms then mix them together with different amplitudes. I am using the paFloat32 data format.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123