unofficial mirror
 help / color / Atom feed
From: Jeremy Nicoll - ml sox users <>
Subject: Re: Basic questions on SoX for Mac OS
Date: Tue, 24 Dec 2019 12:51:09 +0000
Message-ID: <> (raw)
In-Reply-To: <>

On 2019-12-23 16:29, Matthew Mitcheltree wrote:

> I copied the input.dat file to Downloads > sox-14.4.2 as well.
> So when I launch terminal, navigate there, and enter "sox input.dat
> output.wav," I get the error:
> -bash: sox: command not found

> So, maybe I need to install SoX

I don't think so.  But when you issue a command in the terminal, the
command's executable either needs to be in one of the directories that
the OS always looks in, when looking for executables, or you explicitly
need to tell the OS where the program is.

So in simple tutorials about using terminal (which you can find by
googling for 'mac terminal') you'll see examples of using eg  ls
to list the contents of a directory, mv  to move files etc... but
'ls' and 'mv' are part of the Mac OS and it already knows how to
find those.

How?  They're in directories which are defined/listed on something
called PATH.

So, one solution would be to add the Downloads\sox-14.4.2
directory to PATH, so the OS would always look in there when looking
for any executable to run.

I don't know if that's a good idea though.  If you did that with all
the command-line programs you download, PATH would be long, and you'd
need to keep changing it as you installed or replaced utilities.  Still,
it's possible.  See eg:

Or, having navigated to the directory that contains the sox executable
you should issue a command like:

    ./sox input.dat output.wav

That explicitly tells the OS to run the program it'll find at "./sox"
that is, in the current directory.  (Dot means 'current directory' so
"./abc" means file abc in the current directory.)

Some people, I think, explicitly set up PATH so the OS will always
look in the current directory (which obviously varies as you navigate
around), as well as fixed places (where system commands live), but
that also may not be a great idea.  It's discussed in

Another possibility is that rather than navigating to the directory
which contains the sox executable, so you don't bother navigating
to it, but instead always say in the command you're issuing where
(in absolute/explicit terms) the sox executable is.   So instead of

    sox input...

you'd issue eg

    ~\Downloads\sox-14.4.2\sox input ...

(or something.  I'm not precisely sure of what the full path to a Mac
Downloads directory is).

There will be ways (in bash for example) of predefining a shorthand
'alias' for commands so you might be able eg to define 'mysox' as
'~\Downloads\sox-14.4.2\sox' and then issue

   mysox input...

from any terminal window without first navigating to the sox directory.
See eg:

> ... so I wonder whether a "SoX guide for command-line beginners"
> would be a welcome addition to the program documentation?

None of this is specific to sox; it applies to every command-line

The approach you take wil depend on what you think suits you best,
for all command-line programs.

On Windows, I adopt the approach of always putting the full path to
sox (or any other utility program I use) into the command.  It means
I can have different versions of the command-line programs installed
and always know which one I'm using.

Jeremy Nicoll - my opinions are my own

Sox-users mailing list

  parent reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-23 16:29 Matthew Mitcheltree
2019-12-23 16:45 ` Graff, David E
2019-12-24 12:51 ` Jeremy Nicoll - ml sox users [this message]
2019-12-27 21:45   ` Matt Mitcheltree

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:

  List information:

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

  git send-email \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link unofficial mirror

Archives are clonable: git clone --mirror

Example config snippet for mirrors

Newsgroups are available over NNTP:

 note: .onion URLs require Tor:

AGPL code for this site: git clone