From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kevin Conder Newsgroups: gmane.comp.audio.sox Subject: Re: Fwd: Re: merging mono files Date: Sun, 11 Dec 2016 01:44:39 -0600 Message-ID: References: <11f05ac1-4afa-93d1-7563-67607ebeb066@gmail.com> <20161209135153.GI62092@www.stare.cz> <4b6af234-1113-c87f-57f4-78345f039a23@gmail.com> <43a8dfbd-ea02-c1f1-e18e-393bcff0f43b@eckner.net> <3a036732e30b6237a82ed45a60f92ed8@wingsandbeaks.org.uk> <4a6e2cd0-009c-05d7-ff6e-e2e3462a455f@gmail.com> <9616ecf7b1c1f2ce0c853ccc8218512f@wingsandbeaks.org.uk> <6533c36b-631b-cc83-0980-17bed81ee74c@gmail.com> <20161210215259.GB98254@www.stare.cz> <22eb14b9-3254-f2f2-0b2e-bee3977eeef5@gmail.com> <1350f8ed-ba69-6869-265f-769332e21c0a@eckner.net> Reply-To: sox-users@lists.sourceforge.net NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1481442299 22720 195.159.176.226 (11 Dec 2016 07:44:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Dec 2016 07:44:59 +0000 (UTC) To: sox-users@lists.sourceforge.net Original-X-From: sox-users-bounces@lists.sourceforge.net Sun Dec 11 08:44:55 2016 Return-path: Envelope-to: gcas-sox-users@gmane.org Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; envelope-from=dentalkevin@gmail.com; helo=mail-ua0-f180.google.com; X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=hpnXhU9/kZQKLwa0zcQhjlYMsfPEDcW+UGUpcckVoBU=; b=ao46xxdJT4MS6wAnUxGxHtRuYA2dkHTtosbPgpln0CLakgUcBoqbp1Uba+6RV5rWWr DBW6TNyYHaB7DqJOLensEhQysGBhKKCqJWaTK7zU9c1gQ2RcOThNVLWv6wRsLylu9nHS zj03L8CL8Q4jUhLW8HTXgoE95yuqPu7aIagh5Fy1xLQHqFoOL4rBmCfQDwwgzIWuDejg UazWONVOFpAdACSEOsg+T2wzJ58M8mkHo6BAk2n9iSW4oQ2RVpQPHvsXsCkJOtgPZr19 4f1C3yoBMtgR5LPEGd9pydpuhRVhvTOsS5lIJ/kEoY0WpFFK5JnwMJmpE/tOvfu7tFf/ ofxQ== X-Gm-Message-State: AKaTC00+x/t0DXLFXu0khtWNyi1ABcbT5UHuHxsKQVjoV4Y7b7tZ2Ha3iaM6jd5N1QSD98Kg3nPxjU1WRZdB/Q== X-Received: by 10.176.5.137 with SMTP id e9mr55334087uae.109.1481442280137; Sat, 10 Dec 2016 23:44:40 -0800 (PST) In-Reply-To: <1350f8ed-ba69-6869-265f-769332e21c0a@eckner.net> X-Headers-End: 1cFyoP-00084Q-PO X-BeenThere: sox-users@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: sox-users-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.comp.audio.sox:6415 Archived-At: Received: from lists.sourceforge.net ([216.34.181.88]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cFyoY-00054C-MZ for gcas-sox-users@gmane.org; Sun, 11 Dec 2016 08:44:54 +0100 Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cFyoR-0007D1-JZ; Sun, 11 Dec 2016 07:44:47 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cFyoQ-0007Cf-MY for sox-users@lists.sourceforge.net; Sun, 11 Dec 2016 07:44:46 +0000 Received: from mail-ua0-f180.google.com ([209.85.217.180]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) id 1cFyoP-00084Q-PO for sox-users@lists.sourceforge.net; Sun, 11 Dec 2016 07:44:46 +0000 Received: by mail-ua0-f180.google.com with SMTP id 12so55925491uas.2 for ; Sat, 10 Dec 2016 23:44:45 -0800 (PST) Received: by 10.103.71.81 with HTTP; Sat, 10 Dec 2016 23:44:39 -0800 (PST) On Sun, Dec 11, 2016 at 12:43 AM, Erich Eckner wrote: > a quick search for "bash to windows shell converter" on google lead to: > > http://stackoverflow.com/questions/3200018/how-do-i-convert-a-bash-shell-script-to-a-bat-file > > wich seems to explain nearly all parts, you need to "translate" the bash > scrip from Jan Stary into a .bat file. Here's a quick VBScript file that I wrote instead. Make sure you change the soxCommand variable to point to where your sox.exe file is installed. Change all of the directory variables to your actual directory locations before running it. Save the script as "combine.vbs" and run it using "cscript combine.vbs". ' combine.vbs - Combine audio files from different directories. Option Explicit Dim exec Dim file Dim fileName Dim fso Dim leftDir Dim leftFolder Dim rightDir Dim shell Dim soxCommand Dim stereoDir Dim subFolder Dim subName ' Make sure these paths are correct before running. soxCommand = "C:\Program Files (x86)\sox-14-4-2\sox.exe" leftDir = "C:\Users\markb\Desktop\instruments\Basson16L\" rightDir = "C:\Users\markb\Desktop\instruments\Basson16R\" stereoDir = "C:\Users\markb\Desktop\instruments\Basson16S\" ' Use standard Windows objects. Set fso = CreateObject("Scripting.FileSystemObject") Set shell = CreateObject("WScript.Shell") Sub CreateDir(name) ' Create a directory, if it does not exist. If Not fso.FolderExists(name) Then fso.CreateFolder(name) End If End Sub ' Create a directory for the combined stereo files. CreateDir(stereoDir) ' Loop through all of the subdirectories in the Left directory. Set leftFolder = fso.GetFolder(leftDir) For Each subFolder in leftFolder.SubFolders ' Create a corresponding subdirectory for the combined files. subName = subFolder.name CreateDir(stereoDir & subFolder.name) ' Loop through all of the the files in the subdirectory. For Each file in subFolder.Files ' Execute the sox command for each file. fileName = file.Name Set exec = shell.Exec(soxCommand & " -M " & _ leftDir & subName & "\" & fileName & " " & _ rightDir & subName & "\" & fileName & " " & _ stereoDir & subName & "\" & fileName) WScript.Echo stereoDir & subName & "\" & fileName Next Next WScript.Echo "Done." -- Kevin Conder ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today.http://sdm.link/xeonphi