Re: Basic questions on SoX for Mac OS

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

 



Problem solved, thank you Jeremy and David!

The “./“ made all the difference. With that in place, sox produced exactly the wav file I was hoping for. 

I’m a little ashamed of asking for help on so small a problem, but you’ll have to believe I gave it the old college try before posting. Fundamentals can be the hardest to learn so I’m grateful for your taking the time to explain (and for all the helpful links)!

Enjoy the weekend,

Matt

>> On Dec 24, 2019, at 7:51 AM, Jeremy Nicoll - ml sox users <jn.ml.sxu.88@xxxxxxxxxxxxxxxxxxxx> wrote:
>> 
>> 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:
> 
> http://osxdaily.com/2014/08/14/add-new-path-to-path-command-line/
> 
> 
> 
> 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
> 
> https://en.wikipedia.org/wiki/PATH_(variable)
> 
> 
> 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:
> https://www.cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix.html
> 
> 
> 
>> ... 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
> program.
> 
> 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
> Sox-users@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/sox-users


_______________________________________________
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