#!/bin/bash

# This is a small convenience wrapper for converting
# a wav file to an 8 bit RAW PCM file for Amiga sound
if [ "$#" -ne 2 ] ; then
  echo "usage: ratr0-wav2raw8 <infile.wav> <outfile>"
  exit 1;
fi

exe_path=$(command -v sox)
echo "exe path: $exe_path"
if [ -x "$exe_path" ] ; then

  # sox -t wav $1 -b 8 -t s8 $2 channels 1 rate 22050
  #sox -t wav $1 -b 8 -t s8 $2 channels 1 rate 11025
  sox -t wav $1 -b 8 -t s8 $2 channels 1 rate 14k
else
  echo "The sox command was not found, please ensure that sox is installed and in the executable path"
fi

