All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* How to play different audio data on the left and right channel at the same time?
@ 2002-12-21 12:02 超 李
  2002-12-21 18:42 ` drclaw
  0 siblings, 1 reply; 2+ messages in thread
From: 超 李 @ 2002-12-21 12:02 UTC (permalink / raw
  To: alsa-devel

Hi,
  I want to play different wave file on two channel at the same time, that's 
one wave file for left channel, and the other for right channel, can I 
achieve this with the alsa lib on linux? Need I open the sound device twice?
  Thx!

Walter


_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 3 months FREE*. 
http://join.msn.com/?page=features/featuredemail&xAPID=42&PS=47575&PI=7324&DI=7474&SU= 
http://www.hotmail.msn.com/cgi-bin/getmsg&HL=1216hotmailtaglines_addphotos_3mf



-------------------------------------------------------
This SF.NET email is sponsored by: Order your Holiday Geek Presents Now!
Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap,
MP3 Players,  XBox Games,  Flying Saucers,  WebCams,  Smart Putty.
T H I N K G E E K . C O M       http://www.thinkgeek.com/sf/

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

* Re: How to play different audio data on the left and right channel at the same time?
  2002-12-21 12:02 How to play different audio data on the left and right channel at the same time? 超 李
@ 2002-12-21 18:42 ` drclaw
  0 siblings, 0 replies; 2+ messages in thread
From: drclaw @ 2002-12-21 18:42 UTC (permalink / raw
  To: alsa-devel; +Cc: flyingwalter

On Sat, Dec 21, 2002 at 08:02:19PM +0800, ??? ??? wrote:
> Hi,
>  I want to play different wave file on two channel at the same time, that's 
> one wave file for left channel, and the other for right channel, can I 
> achieve this with the alsa lib on linux? Need I open the sound device twice?
>  Thx!
> 

Well, there are 2 ways to do this:

1. The Programming Way:  Just interleave the samples from each wav, in
other words, lets call your 2 files left.wav and right.wav.  Feed your
soundcard a stream of samples that go left.wav[sample0],
right.wav[sample0], left.wav[sample1], right.wav[sample1], etc...  Just
remember that it goes left, right, left, right, etc.  

2. The Non-Programming Way:  Open up your favorite wav editor and assign
one wav to the left channel and one wav to the right channel and save
it.  This is the way you'd do it if you only had a few of these double
wav's that you wouldn't have to change much.  If you have a lot of them
and need to make fast decisions about what you're doing, you can use the
command line program SoX to pan each in either direction and play them
simultaneously.  I can't think of the specific options but you can find
them in the SoX manpage, SoX seriously does *every* simple operation
you'd want to perform on an audio file.  

I hope this helps,

784 - Michael C. Piantedosi - drclaw@dogsolitude.org


-------------------------------------------------------
This SF.NET email is sponsored by: Order your Holiday Geek Presents Now!
Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap,
MP3 Players,  XBox Games,  Flying Saucers,  WebCams,  Smart Putty.
T H I N K G E E K . C O M       http://www.thinkgeek.com/sf/

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

end of thread, other threads:[~2002-12-21 18:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-21 12:02 How to play different audio data on the left and right channel at the same time? 超 李
2002-12-21 18:42 ` drclaw

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.