public inbox for speakup@linux-speakup.org
 help / color / mirror / Atom feed
* requesting script
@  Tyler Spivey
   ` Charles Hallenbeck
   ` Geoff Shang
  0 siblings, 2 replies; 3+ messages in thread
From: Tyler Spivey @  UTC (permalink / raw)
  To: speakup

can someone please send me the /usr/bin/rec script from sox?
it's not in the sox distribution that comes with my linux distro.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: requesting script
   requesting script Tyler Spivey
@  ` Charles Hallenbeck
   ` Geoff Shang
  1 sibling, 0 replies; 3+ messages in thread
From: Charles Hallenbeck @  UTC (permalink / raw)
  To: speakup

On my Slackware 8.0 system /usr/bin/rec is a symbolic link to
/usr/bin/play


On Tue, 15 Jan 2002, Tyler Spivey wrote:

> can someone please send me the /usr/bin/rec script from sox?
> it's not in the sox distribution that comes with my linux distro.
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>

*<<<=-=>>>*<<<=-=>>>*<<<=-=>>>*<<<=-=>>>*
Visit me at http://www.mhonline.net/~chuckh
The Moon is Waxing Crescent (8% of Full)



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: requesting script
   requesting script Tyler Spivey
   ` Charles Hallenbeck
@  ` Geoff Shang
  1 sibling, 0 replies; 3+ messages in thread
From: Geoff Shang @  UTC (permalink / raw)
  To: speakup

[-- Attachment #1: Type: TEXT/PLAIN, Size: 187 bytes --]

Hi:

If you have play, it's the same script.  It obviously determins how it was
called.

If you don't have play, please find attached.  Just in case anyone else is
in your boat.

Geoff.


[-- Attachment #2: Type: TEXT/PLAIN, Size: 5007 bytes --]

#!/bin/sh
# Shell script to play/record sound files to/from unix style sound devices.
# Should auto detect most supported systems.
#
# Originally developed by Chris Bagwell (cbagwell@sprynet.com)
#
#   TODO:  Put each set of fopts and filenames on an array and then 
#          play each filename back with the given effect.h
#
# Change History:
#
#   Major updates have been supplied by Kjetil Torgrim Homme and 
#   Kirk Goff.

# Set up path so that it can find Sox if user's path doesn't already
# include it.
PATH=$PATH:/usr/local/bin
program_name=`basename $0`
program_version="2.0"


if [ -z "$1" ]; then
    echo "\
$program_name: too few arguments
Try \`$program_name --help' for more information." 1>&2
    exit 1
fi

[ -t 1 ] || silent=1 # don't show anything if stdout isn't a tty

version()
{
    echo "$program_name (sox) $program_version"
    exit 0
}

help()
{
    echo "\
Usage: $program_name [OPTION]... FILE [EFFECT]...
Play/record sound files to/from unix style sound devices.

  -c, --channels=CHANNELS      specifies the number of sound channels in FILE
  -d, --device=DEVICE          use DEVICE for input/output
  -f, --format=FORMAT          specifies bit format of sample
                               FORMAT is either s, u, U, A, a, or g
  -r, --rate=RATE              sample rate in hertz of FILE
  -s, --size=SIZE              interpret size of sample
                               SIZE is either b, w, l, f, d, or D
  -t, --type=TYPE              specifies file format of FILE
  -v, --volume=VOLUME          change amplitude
  -x, --xinu                   reverse bit order of sample
                               (only works with 16-bit and 32-bit integer data)
      --file                   next argument is FILE
  -h, --help                   display this help and exit
      --version                output version information and exit
      --silent                 do not display filename of currently played file

EFFECTs are one or more of the following:  avg, band, chorus, copy, cut, 
deemph, echo, echos, flanger, highp, lowp, map, mask, phaser, pick, polyphase
rate, resample, reverb, reverse, split, stat, vibro.

See sox man page for detailed information on supported file types, data
formats, and effect options."
    exit 0
}

count=0

# loop over arguments
while [ $# -ne 0 ]; do
    case "$1" in
	avg|band|chorus|copy|cut|deemph|echo|echos|flanger|highp|lowp|map|mask|phaser|pick|polyphase|rate|resample|reverb|reverse|split|stat|vibro)
	    effects="$@"
	    break
	    ;;
	-c)
	    shift
	    fopts="$fopts -c $1"
	    ;;
	--channels=*)
	    fopts="$fopts -c `echo $1 | sed 's/.*=//'`"
	    ;;
	-d)
	    shift
	    device="$1"
	    ;;
	--device=*)
	    device=`echo $1 | sed 's/.*=//'`
	    ;;
	-f)
	    shift
	    fopts="$fopts -$1"
	    ;;
	--format=*)
	    fopts="$fopts -`echo $1 | sed 's/.*=//'`"
	    ;;
	-r)
	    shift
	    fopts="$fopts -r $1"
	    ;;
	--rate=*)
	    fopts="$fopts -r `echo $1 | sed 's/.*=//'`"
	    ;;
	-s)
	    shift
	    fopts="$fopts -$1"
	    ;;
	--size=*)
	    fopts="$fopts -`echo $1 | sed 's/.*=//'`"
	    ;;
	-t)
	    shift
	    fopts="$fopts -t $1"
	    ;;
	--type=*)
	    fopts="$fopts -t `echo $1 | sed 's/.*=//'`"
	    ;;
	-v)
	    shift
	    volume="-v $1"
	    ;;
	--volume=*)
	    volume="-v `echo $1 | sed 's/.*=//'`"
	    ;;
	-x|--xinu)
	    fopts="$fopts -x"
	    ;;
	--file)
	    shift
	    if [ -z "$filename_0" ]; then
		filename_0="$1"
	    else
		echo "Filename already given.  Ignoring extra name: $1" 1>&2
	    fi
	    ;;
	-h)
	    help
	    ;;
	--help)
	    help
	    ;;
	--version)
	    version
	    ;;
        --silent)
            silent=1
            ;;
	-)
	    eval filename_$count=-
            count=$(($count+1))
	    ;;
	-*)
	    fopts="$fopts $1"
	    ;;
	*)
	    eval filename_$count='"$1"'
            count=$(($count+1))
	    ;;
    esac
    shift
done

arch=`uname -s`
case $arch in
  SunOS)
    case `arch -k` in
	# Use below for older Sun audio hardware
	sun4|sun4c|sun4d)
	    arch_defines="-t sunau -U -c 1"
	    ;;
	# Use below for newer Sun audio hardware that supports stereo linear
	*)
	    arch_defines="-t sunau -w -s"
	    ;;
    esac
    if [ -z "$device" ]; then
	device="/dev/audio"
    fi
    ;;
  Linux|FreeBSD)
    arch_defines="-t ossdsp"
    if [ -z "$device" ]; then
	device="/dev/dsp"
    fi
    ;;
esac

# If name is "rec" then record else assume user is wanting to play
# a sound file.
if [ "$program_name" = "rec" ]; then
    echo "Send break (control-c) to end recording"
    sox $volume $arch_defines $fopts $device "$filename_0" $effects
else
    i=0
    while test $i -lt $count; do
	if test -z "$silent"; then
	    eval 'echo "playing $filename_'$i'"'
	fi
	eval 'sox $volume $fopts "$filename_'$i'" $arch_defines $device $effects'
	i=$(($i+1))
    done
fi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~ UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
 requesting script Tyler Spivey
 ` Charles Hallenbeck
 ` Geoff Shang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).