sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* Basic questions on SoX for Mac OS
@ 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
  0 siblings, 2 replies; 4+ messages in thread
From: Matthew Mitcheltree @ 2019-12-23 16:29 UTC (permalink / raw)
  To: sox-users


[-- Attachment #1.1: Type: text/plain, Size: 1369 bytes --]

Hi there,

A chemist and musician here – a project of mine to convert NMR FID signals
to WAV audio files has brought me to SoX (via:
https://www.quora.com/How-do-I-convert-a-CSV-file-to-a-wav-file). Toward
that end, I've generated a 1-channel .dat file with normalized amplitude
values and 9.615 kHz sample rate as input for SoX. The issue I'm running
into has everything to do with my limited literacy with command line, a
lack of rudimentary documentation from SoX on installation and operation,
or a little of both.

I'm running on a Mac, and have the SoX v14.4.2 package in my Downloads
directory. 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, as this thread would have me believe (
https://sourceforge.net/p/sox/mailman/sox-users/thread/col102-w436DF8E69EB76243646E30C3CF0%40phx.gbl/#msg27208706).
But I admit I can't find how to do that. Am I on the right track?

Any guidance you all can offer would go a long way. SoX seems to have
capabilities valuable to people with skills far afield from computer
programming, so I wonder whether a "SoX guide for command-line beginners"
would be a welcome addition to the program documentation?

Thank you!
Matt

[-- Attachment #1.2: Type: text/html, Size: 2003 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

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

* Re: Basic questions on SoX for Mac OS
  2019-12-23 16:29 Basic questions on SoX for Mac OS Matthew Mitcheltree
@ 2019-12-23 16:45 ` Graff, David E
  2019-12-24 12:51 ` Jeremy Nicoll - ml sox users
  1 sibling, 0 replies; 4+ messages in thread
From: Graff, David E @ 2019-12-23 16:45 UTC (permalink / raw)
  To: sox-users


[-- Attachment #1.1: Type: text/plain, Size: 2391 bytes --]

Are you familiar with “MacPorts” or “Homebrew” ? These are “package managers” that make it possible/easy to install pre-compiled versions of open-source software on macosx; both of them provide installable versions of “sox”.

If you have one of those in place already, just use it’s command-line interface to install sox; if not, look at both of their websites to decide which one you think is better geared to your level of understanding, install that package manager, then use it to install sox.  The latter step will put the “sox” command in one of the standard directories where the unix shell (the terminal’s command-line interface) looks for executable programs.

Good luck.
   David Graff

From: Matthew Mitcheltree <m.mitcheltree@gmail.com>
Reply-To: "sox-users@lists.sourceforge.net" <sox-users@lists.sourceforge.net>
Date: Monday, December 23, 2019 at 11:29 AM
To: "sox-users@lists.sourceforge.net" <sox-users@lists.sourceforge.net>
Subject: [SoX-users] Basic questions on SoX for Mac OS

Hi there,

A chemist and musician here – a project of mine to convert NMR FID signals to WAV audio files has brought me to SoX (via: https://www.quora.com/How-do-I-convert-a-CSV-file-to-a-wav-file). Toward that end, I've generated a 1-channel .dat file with normalized amplitude values and 9.615 kHz sample rate as input for SoX. The issue I'm running into has everything to do with my limited literacy with command line, a lack of rudimentary documentation from SoX on installation and operation, or a little of both.

I'm running on a Mac, and have the SoX v14.4.2 package in my Downloads directory. 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, as this thread would have me believe (https://sourceforge.net/p/sox/mailman/sox-users/thread/col102-w436DF8E69EB76243646E30C3CF0%40phx.gbl/#msg27208706). But I admit I can't find how to do that. Am I on the right track?

Any guidance you all can offer would go a long way. SoX seems to have capabilities valuable to people with skills far afield from computer programming, so I wonder whether a "SoX guide for command-line beginners" would be a welcome addition to the program documentation?

Thank you!
Matt

[-- Attachment #1.2: Type: text/html, Size: 5476 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

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

* Re: Basic questions on SoX for Mac OS
  2019-12-23 16:29 Basic questions on SoX for Mac OS Matthew Mitcheltree
  2019-12-23 16:45 ` Graff, David E
@ 2019-12-24 12:51 ` Jeremy Nicoll - ml sox users
  2019-12-27 21:45   ` Matt Mitcheltree
  1 sibling, 1 reply; 4+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2019-12-24 12:51 UTC (permalink / raw)
  To: sox-users

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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

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

* Re: Basic questions on SoX for Mac OS
  2019-12-24 12:51 ` Jeremy Nicoll - ml sox users
@ 2019-12-27 21:45   ` Matt Mitcheltree
  0 siblings, 0 replies; 4+ messages in thread
From: Matt Mitcheltree @ 2019-12-27 21:45 UTC (permalink / raw)
  To: sox-users

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@wingsandbeaks.org.uk> 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@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users


_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

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

end of thread, other threads:[~2019-12-27 21:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-23 16:29 Basic questions on SoX for Mac OS Matthew Mitcheltree
2019-12-23 16:45 ` Graff, David E
2019-12-24 12:51 ` Jeremy Nicoll - ml sox users
2019-12-27 21:45   ` Matt Mitcheltree

sox-users@lists.sourceforge.net unofficial mirror

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/sox-users

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 sox-users sox-users/ https://public-inbox.org/sox-users \
		sox-users@lists.sourceforge.net
	public-inbox-index sox-users

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.audio.sox
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.audio.sox
	nntp://news.gmane.io/gmane.comp.audio.sox
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git