#!/usr/bin/perl
#
# Author: Peter Keel <killer@discordia.ch>
# This converts 8svx-files to wav-files.
#

die "Usage: $0 filenames\n" unless($ARGV[0]);

chop ( $PWD = `pwd`);
$base_dir = $PWD;

foreach $file_name (@ARGV)
    {
	print STDERR "Processing '$file_name'\n";
	# Given the files have no extension (such as coming from Amiga),
	# in any other case uncomment this:
	# $indice = index $file_name, ".";
	# $new_file = substr $file_name, 0, $indice ;
	$new_file = $file_name.".wav";
        system ("sox -t 8svx -x $file_name -u -t wav $new_file");
    }
