Skip to content

Not Understanding Command Line & Scripting Use... #71

@MrMendelli

Description

@MrMendelli

I'm trying to create an advanced encoding script to process multiple files at once, but I am unable to get even one file to convert successfully this way. I'm not understanding some of the documentation and have some questions:

From the wiki, the heading on creating WAV files seems straightforward enough:

# Create a wav file
spcplay.exe -wav [[-s <channels: 1-8>]/[-m <channels: 1-8>]] [-v <volume %>]
                 [-o <.wav file path>] [-f] <.spc file path>

If I understand correctly, -wav is the command instructing SPC Play to encode as WAV, -s is for stereo and -m is for mono and both are represented by an integer (1-8), and -v is represented by an integer (1-100). Assuming I am understanding correctly, then an example should look like this:
spcplay -wav -s 8 -v 100 -o output.wav -f input.spc

If this is correct, the example script from the wiki is a bit confusing, and trying to implement it as well as making my own adjustments yields no success:

start spcplay.exe
timeout 1
FOR %%I IN (1 2 3 4 5 6 7 8) DO spcplay.exe -wav -s %%I -o output-%%I.wav input.spc
  1. I don't understand why the first two lines are used here if the third line already executes spcplay.exe...
  2. In a for loop in Batch, the first parenthesis is used for the argument, and is usually whatever the input would be, so I don't understand what 1 2 3 4 5 6 7 8 is doing here...
  3. I suppose this is more subjective, but typically in similar uses, the input file is provided before the output file in a command, so -o coming before -f is also confusing... I did try swapping the order, but it made no difference.

From my experience in writing scripts, how this would look in any other instance would be more like the following:

for %%i in (
    input.spc
) do (
    spcplay -wav -s 8 -v 100 -f %%i -o output.wav
)

Trying it this way also does not work. Worth noting, irrespective of how I write or rearrange my code, a consistent problem is that the script returns the following error:
Windows cannot find '-wav'. Make sure you typed the name correctly, and then try again.

This may be due to my use of double quote-wrapping things, but this is also necessary in Windows with scripting or commands if a path or file name contains spaces at any point.

I have even tried the following code, with all files specified in the working directory with no luck:
spcplay -wav -s 8 -v 100 -o title.wav -f title.spc
SPC Play runs but returns error 201.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or requestfixedThis issue was fixed, waiting for stable release

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions