简体   繁体   English

如何在 windows 中使用 sox

[英]How to use sox in windows

I am installing sox in windows , but I get an error entering the following code: sox 001.wav 001.dat in the command line .我在windows中安装sox ,但输入以下代码时出错: sox 001.wav 001.dat in the command line

The error is:错误是:

`sox is not recognized as an internal or external command, operable program or batch file.`

Add the Sox folder to your PATH and then restart your terminal. 将Sox文件夹添加到PATH,然后重新启动终端。

  1. Go to My Computer → Properties → Advanced System Settings → Environment Variables → System variables. 转到我的电脑→属性→高级系统设置→环境变量→系统变量。
  2. Select Path. 选择路径。
  3. Click Edit → New : 单击编辑→新建:
  4. Add this: C:\\Program Files (x86)\\sox-<CHECK YOUR VERSION NUMBER>\\ 添加: C:\\Program Files (x86)\\sox-<CHECK YOUR VERSION NUMBER>\\
    • As indicated in the example path, make sure to check what version of Sox you have installed by actually navigating to your Program Files (x86) folder and looking for a folder that starts with sox , for example sox-14-4-2 . 如示例路径中所示,请确保通过实际导航到Program Files (x86)文件夹并查找以sox开头的文件夹(例如sox-14-4-2 Program Files (x86)来检查已安装的Sox版本。
  5. Restart your terminal. 重启你的终端。
    • Note that if you're using an IDE, you may need to restart the IDE to have the Path variables update. 请注意,如果您使用的是IDE,则可能需要重新启动IDE才能更新Path变量。

我进入了我的sox目录文件夹并使用了'./sox'命令而不仅仅是'sox'而且它有效。

Not sure if this will be approved of but... I open the command line and navigate to the folder containing sox.不确定这是否会被批准,但是...我打开命令行并导航到包含 sox 的文件夹。 For me this is:对我来说这是:

‪cd C:\Program Files (x86)\sox-14-4-2\

To get this just find the sox.exe file, right click on it and copy the full file path shown as the 'Object Name' the top of the security tab just omitting the 'sox.exe' file name.为此,只需找到 sox.exe 文件,右键单击它并复制显示为安全选项卡顶部的“对象名称”的完整文件路径,只是省略“sox.exe”文件名。 在此处输入图像描述

I then put the files I want to convert in that folder (ensuring there are no spaces in the file names - as there often are with music files).然后,我将要转换的文件放在该文件夹中(确保文件名中没有空格 - 就像音乐文件一样)。 This makes the file paths for the files being processed and the naming of the output file much easier to handle.这使得正在处理的文件的文件路径和 output 文件的命名更易于处理。 eg If I'm using the CD de-emphasis filter the command would look like this:例如,如果我使用 CD 去加重过滤器,命令将如下所示:

sox.exe Music.wav Music_deemph.wav deemph

This takes the Music.wav file, processes it and places the processed file I have named Music_deemph.wav in the same folder.这将获取 Music.wav 文件,对其进行处理并将处理后的文件放置在我命名为 Music_deemph.wav 的同一文件夹中。 Possibly not ideal to be messing around in the program folder by placing the files being processed in there, but for those of us who don't use the Command Line that often it makes things a little easier, as the instructions are far less verbose.通过将正在处理的文件放置在程序文件夹中来弄乱程序文件夹可能并不理想,但是对于我们这些不使用命令行的人来说,这通常会使事情变得更容易,因为说明要简单得多。 The above command would read as follows if I left the music file in its original folder:如果我将音乐文件留在其原始文件夹中,上述命令将如下所示:

sox.exe C:\Users\David-PC\OneDrive\Music\Music.wav C:\Users\David-PC\OneDrive\Music\Music_deemph.wav deemph

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM