⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sdcomp.sh

📁 speech signal process tools
💻 SH
字号:
#! /bin/sh#---------------------------------------------------------------+#								|#   This material contains proprietary software of Entropic	|#   Processing, Inc.  Any reproduction, distribution, or	|#   publication without the the prior written permission of	|#   Entropic Processing, Inc. is strictly prohibited.  Any	|#   public distribution of copies of this work authorized in	|#   writing by Entropic Processing, Inc. must bear the notice	|#								|#          "Copyright 1986 Entropic Processing, Inc."		|#								|#---------------------------------------------------------------+#								|#  sdcomp -- compare sampled-data files by listening		|#								|#  Rodney W. Johnson, Entropic Processing, Inc.			|#								|#  This program cycles through one or more SPS SD files,	|#  playing a portion from each file by means of the local	|#  "play" program (e.g. mcplay on the MASSCOMP).  It assumes	|#  that the local play program has the same command line 	|#  options as mcplay.  After sdcomp starts and after a portion	|#  is played from each file, the user is prompted for the next	|#  action.  The following commands are then accepted (<CR>	|#  refers to the "return" key):					|#  								|#  <CR>     play next portion from each file			|#  r<CR>    repeat current portion from each file		|#  b<CR>    back up:  play previous portion from each file	|#  c<CR>    continue playing portions without stopping for	|#           commands						|#  q<CR>    quit						|#  								|#---------------------------------------------------------------+# Sccs information:  @(#)sdcomp.sh	1.4  10/20/86# Name of local "play" programplay=mcplayusage="Usage: sdcomp [-x debug-level] [-{psf} range] [-g gain] \[-w width] [-r nrepeat] [-c channel] [-i] [-b shift-value] \[-d delay] [-n step] file.sd [file.sd ...]"xoption=goption=woption=roption=coption=ioption=boption=# Default range is -s0:+1rangeswitch="-s"range=start=incr=delay=step=# "c" command not yet seen.continuing=no# Get command-line options.while :do    case $1 in    -x)        xoption="$1$2"        shift 2 ;;    -x*)        xoption=$1        shift ;;    -g)        goption="$1$2"        shift 2 ;;    -g*)        goption=$1        shift ;;    -w)        woption="$1$2"        shift 2 ;;    -w*)        woption=$1        shift ;;    -r)        roption="$1$2"        shift 2 ;;    -r*)        roption=$1        shift ;;    -c)        coption="$1$2"        shift 2 ;;    -c*)        coption=$1        shift ;;    -i)        ioption="$1"        shift ;;    -b)        boption="$1$2"        shift 2 ;;    -b*)        boption=$1        shift ;;    -d)        delay=$2        shift 2 ;;    -d*)        delay=`echo $1 | awk '{print substr($0, 3)}'`        shift ;;    -n)        step=$2        shift 2 ;;    -n*)        step=`echo $1 | awk '{print substr($0, 3)}'`        shift ;;    -[psf])        rangeswitch=$1        range=$2        shift 2 ;;    -[psf]*)        rangeswitch=`echo $1 | awk '{print substr($0, 1, 2)}'`        range=`echo $1 | awk '{print substr($0, 3)}'`        shift ;;    -?*)        echo $usage        exit 1 ;;    *)        break ;;    esacdone# What's left must be filenames.  Require at least 1.case $# in0)    echo $usage    exit 1 ;;esac# Starting location is the part of the range specification# before the ":" if any.  Defaults are 0 sec, point 1, and# frame 1.case $range in""|:*)    case $rangeswitch in    -s)        start=0 ;;    *)        start=1 ;;    esac ;;*:*)    start=`echo $range | awk -F: '{print $1}'` ;;*)    start=$range ;;esac# The portion length is (incr) if the range is given in sec,# (incr+1) if points or frames.  The incr is as given if the# range has the form <start>:+<incr> and is end-start if the# range has the form <start>:<end>; defaults are 7999 points,# 1 sec, and 79 frames.  These give equivalent portion lengths# when the sampling frequency is 8000 Hz and the frame size is# 100.case $range in""|*:)    case $rangeswitch in    -p)        incr=7999 ;;    -s)        incr=1 ;;    -f)        incr=79 ;;    esac ;;*:+*)    incr=`echo $range | awk -F: '{print 0 + $2}'` ;;*:*)    incr=`echo $range | awk -F: '{print $2 - '$start'}'` ;;*)    incr=0 ;;esac# Default step size is the portion length.case $step in"")    case $rangeswitch in    -s)        step=$incr ;;    *)        step=`expr $incr + 1` ;;    esac ;;esac# Finally play some speech.while    echo $rangeswitch$start:+$incr    case $delay in    "")        $play $xoption $goption $woption $roption $coption \            $ioption $boption $rangeswitch$start:+$incr $* ;;    *)        for i in $*        do            $play $xoption $goption $woption $roption $coption \                $ioption $boption $rangeswitch$start:+$incr $i \            && sleep $delay        done ;;    esacdo    case $continuing in    no)        echo "sdcomp: \c"        read command        while :        do            case $command in                "")                    start=`expr $start + $step`                    break ;;                r)                    break ;;                b)                    start=`expr $start - $step`                    break ;;                q)                    exit 0                    break ;;                c)                    continuing=yes                    start=`expr $start + $step`                    break ;;                *)                    echo \"sdcomp commands:  empty line plays next portion; \"r\" repeats;"                    echo \"         \"b\" backs up; \"q\" quits; \"c\" continues to end."                    echo "sdcomp: \c"                    read command ;;            esac        done ;;    yes)        start=`expr $start + $step` ;;    esacdoneexit 1

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -