All of lore.kernel.org
 help / color / mirror / Atom feed
* How to mix two PCM channels with ALSA
@ 2012-12-06 12:27 itxEpsilon
  2012-12-06 14:23 ` Clemens Ladisch
  0 siblings, 1 reply; 4+ messages in thread
From: itxEpsilon @ 2012-12-06 12:27 UTC (permalink / raw)
  To: alsa-devel

Dear Alsa developers:

I'm trying to write a simple application 
for mixing two PCM sound channels in
C++. Could anyone provide me a 
quick example about how to implement
this operation?

Thank you in advance.
Itx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to mix two PCM channels with ALSA
  2012-12-06 12:27 How to mix two PCM channels with ALSA itxEpsilon
@ 2012-12-06 14:23 ` Clemens Ladisch
  2012-12-06 16:18   ` itxEpsilon
  0 siblings, 1 reply; 4+ messages in thread
From: Clemens Ladisch @ 2012-12-06 14:23 UTC (permalink / raw)
  To: alsa-devel

itxEpsilon wrote:
> I'm trying to write a simple application
> for mixing two PCM sound channels in
> C++. Could anyone provide me a
> quick example about how to implement
> this operation?

  outputSample[i] = inputChannel1[i] + inputChannel2[i];

What does this have to do with ALSA?


Regards,
Clemens

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to mix two PCM channels with ALSA
  2012-12-06 14:23 ` Clemens Ladisch
@ 2012-12-06 16:18   ` itxEpsilon
  2012-12-06 18:05     ` Clemens Ladisch
  0 siblings, 1 reply; 4+ messages in thread
From: itxEpsilon @ 2012-12-06 16:18 UTC (permalink / raw)
  To: alsa-devel

Clemens Ladisch <clemens <at> ladisch.de> writes:

> 
> itxEpsilon wrote:
> > I'm trying to write a simple application
> > for mixing two PCM sound channels in
> > C++. Could anyone provide me a
> > quick example about how to implement
> > this operation?
> 
>   outputSample[i] = inputChannel1[i] + inputChannel2[i];
> 
> What does this have to do with ALSA?
> 
> Regards,
> Clemens
> 

Hi,
That's no my question, I'd like to know how is performed with the ALSA API.

i.e. 

playSound(buffer1);
playSound(buffer2);

is it implicitly mixed when playing two buffers by hardware?

Thanks.
Carlos.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to mix two PCM channels with ALSA
  2012-12-06 16:18   ` itxEpsilon
@ 2012-12-06 18:05     ` Clemens Ladisch
  0 siblings, 0 replies; 4+ messages in thread
From: Clemens Ladisch @ 2012-12-06 18:05 UTC (permalink / raw)
  To: alsa-devel

itxEpsilon wrote:
> I'd like to know how is performed with the ALSA API.
>
> playSound(buffer1);
> playSound(buffer2);
>
> is it implicitly mixed when playing two buffers by hardware?

Yes, if the hardware actually support this (nowadays, none does), or if
ALSA is configured to use software mixing through dmix or PulseAudio
(which are enabled by default in most distributions).


Regards,
Clemens

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-12-06 18:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-06 12:27 How to mix two PCM channels with ALSA itxEpsilon
2012-12-06 14:23 ` Clemens Ladisch
2012-12-06 16:18   ` itxEpsilon
2012-12-06 18:05     ` Clemens Ladisch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.