Re: [linux-audio-dev] Writing PCM to left and right channel sperately?

From: Paul Davis <paul@email-addr-hidden>
Date: Thu Mar 09 2006 - 18:28:31 EET

On Thu, 2006-03-09 at 17:01 +0100, Tobias Scharnberg wrote:
> What do you mean - there are many ways when using ALSA or are there
> also ways when using OSS. I know - this is RTFM worthy - but I have no
> time for that, so a pointer would be very helpful!

if you use OSS the kernel will print a message complaining about your
application. OSS is an officially deprecated API, and you should not use
it.

> > what type of application are you writing?
>
> The application has to play back automated announcements on a
> amplifier/speaker system but it has to be able to play 2 different
> announcements at the same time - one on the left and one on the right
> channel.

you just take one of the example ALSA PCM apps. they typically configure
the h/w for stereo, interleaved output, often 16 bit samples. then you
just need an array of 16 bit samples, and you write the left/right
samples into alternating entries in the array. write the array. done.

--p
Received on Thu Mar 9 20:15:05 2006

This archive was generated by hypermail 2.1.8 : Thu Mar 09 2006 - 20:15:05 EET