sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
From: Jan Stary <hans@stare.cz>
To: sox-users@lists.sourceforge.net
Subject: Re: Playing multichannel audio files
Date: Wed, 7 Mar 2018 16:14:50 +0100	[thread overview]
Message-ID: <20180307151450.GA44044@www.stare.cz> (raw)
In-Reply-To: <yw1xpo4hjn58.fsf@mansr.com> <87efkxp9m1.fsf@gmail.com> <87r2oxpboh.fsf@gmail.com> <23db1c51b897db1a375bba03b22dd58d@wingsandbeaks.org.uk> <871sgxr2pa.fsf@gmail.com>

On Mar 06 10:08:33, rodolfo.medina@gmail.com 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@mansr.com 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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

      parent reply	other threads:[~2018-03-07 15:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-06  9:08 Playing multichannel audio files Rodolfo Medina
2018-03-06 12:56 ` Jeremy Nicoll - ml sox users
2018-03-06 13:37   ` Rodolfo Medina
2018-03-06 14:22     ` Rodolfo Medina
2018-03-06 14:26     ` Måns Rullgård
2018-03-07 15:14 ` Jan Stary [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.sourceforge.net/lists/listinfo/sox-users

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180307151450.GA44044@www.stare.cz \
    --to=sox-users@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).