Re: Playing multichannel audio files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mar 06 10:08:33, rodolfo.medina@xxxxxxxxx wrote:
> I have a multichannel audio file: suppose three channels.  What I want is to
> listen to that file by listening to each of those channels through a different
> loud speaker.

Do you have three loudspeakers?

> In order to do so, I imagine each channel being sent
> to a different sound card.

Not necessarily. A typical soundcard will have a stereo output,
a fancy soundcard might have more (rear speakers, subwoofer, etc).
https://en.wikipedia.org/wiki/5.1_surround_sound

Also, playing to more than one audio device might not be synchronized,
depending on your OS's audio subsystem.

> Can sox perform that, and how?

I don't think this has anythng to do with SoX.
SoX will read the three channels and will send them to your
audio hardware (or whatever audio subsystem you have between
SoX and the hardware, such as ALSA). It's their problem then.

If your actual audio HW can only play two channels simultaneously
(as is usual), a cheap version would be to stereo-mix your 3 channels
to one in the middle, one left, one right (in the stereo panorama).
That can be one with SoX.

> Two different soundcards, and three devices, seem to be detected:
> 
> $ arecord -l

Recording (capturing) devices are irrelevant to this, obviously ...

> **** List of CAPTURE Hardware Devices ****
> card 1: Generic [HD-Audio Generic], device 0: ALC662 rev3 Analog [ALC662 rev3 Analog]
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> card 1: Generic [HD-Audio Generic], device 2: ALC662 rev3 Alt Analog [ALC662 rev3 Alt Analog]
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> card 2: Device [USB Audio Device], device 0: USB Audio [USB Audio]
>   Subdevices: 0/1
>   Subdevice #0: subdevice #0

... but you probably have two soundcards (sorry, I don't do ALSA).

> Since sox can split a three-channel file into three one-channel files, the
> problem is virtually solved once we manage to send two audio outputs into two
> different audio cards.  This seems to be done simply with `&&', e.g:
>  $ mplayer -ao alsa:device=hw=2.0 file1.wav && mplayer file2.wav
> , but unfortunately only one output is heard at a time...

The way you wrote it, the second mplayer process
is waiting for the forst one to finish.

On Mar 06 14:26:27, mans@xxxxxxxxx wrote:
> Sox can't do that.  However, you can configure ALSA to present a virtual
> 3-channel card with each channel routed to a different slave device.

Yes; it's not a SoX problem, it's an audio system problem:
what to do with the three channels that SoX (or any other
audio application for that matter) is sending.

(You might want to try installing OpenBSD on a spare machine
and try its 'sndio' audio system, which is both fly and dope.)

	Jan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
Sox-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/sox-users



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux