title: Need to process hundreds of text to wav conversions using Swift
body: <p>I own a licensed copy of Swiftalker, which is available at cepstral.com.  It is an application that reads text aloud, and can export to wav.  While it is by far the best I've found in terms of voice, its export options are limited.</p>
  
  <p>What I am doing is using Swiftalker to convert text to wav to study for my architect's license exam.  I have hundreds of small, one-line text files that are terms to be memorized.  I want to use the Swiftalker command to automatically export a whole folder full at a time, rather than typing one line of code hundreds of times.</p>
  
  <p>Cepstral does provide a command line utility that has this syntax:</p>
  
  <p>swift -n Allison -f bdcs002.txt -o bdcs002.wav</p>
  
  <p>(Allison is the voice I have purchased.)  The txt file is what I have, and the Cepstral engine creates the wav's.</p>
  
  <p>The command does not accept wildcards for the input txt file or the output wav file.  It only accepts exact filenames. So I guess I need some kind of for-next loop to execute the above command repeatedly, using variables for filenames?</p>
  
  <p>Using resources on this site, I have developed the batch file below, to extract the needed filenames from a directory called "txt" and store them in text files.  However I don't know how to write a for-next loop to create the wav files from the txt files, using the Cepstral command above.</p>
  
  <p>File extraction batch file:</p>
  
  <pre><code>cd\L:\_ARE\PrepMaterials\__AudioConversionArea
  
  set search=
  setlocal enabledelayedexpansion
  for /r L:\_ARE\PrepMaterials\__AudioConversionArea\txt %%g in (*) do (
  if not defined search (set search=%%~nxg) else set search=!search!,%%~nxg
  )
  echo !search!&gt;&gt;FilenamesAndExensions.txt
  
  
  set search2=
  setlocal enabledelayedexpansion
  for /r L:\_ARE\PrepMaterials\__AudioConversionArea\txt %%g in (*) do (
  if not defined search (set search2=%%~ng) else set search2=!search2!,%%~ng
  )
  echo !search2!&gt;&gt;FilenamesWithoutExtensions.txt
  
  PAUSE
  </code></pre>
  
  <p>Any help would be appreaciated, thank you.</p>