ra2ogg.sh

来自「Shall高级编程」· Shell 代码 · 共 50 行

SH
50
字号
#!/bin/bash# ra2ogg.sh: Convert streaming audio files (*.ra) to ogg.# Uses the "mplayer" media player program:#      http://www.mplayerhq.hu/homepage#      Appropriate codecs may need to be installed for this script to work.# Uses the "ogg" library and "oggenc":#      http://www.xiph.org/OFILEPREF=${1%%ra}      # Strip off the "ra" suffix.OFILESUFF=wav           # Suffix for wav file.OUTFILE="$OFILEPREF""$OFILESUFF"E_NOARGS=65if [ -z "$1" ]          # Must specify a filename to convert.then  echo "Usage: `basename $0` [filename]"  exit $E_NOARGSfi##########################################################################mplayer "$1" -ao pcm:file=$OUTFILEoggenc "$OUTFILE"  # Correct file extension automatically added by oggenc.##########################################################################rm "$OUTFILE"      # Delete intermediate *.wav file.                   # If you want to keep it, comment out above line.exit $?#  Note:#  ----#  On a Website, simply clicking on a *.ram streaming audio file#+ usually only downloads the URL of the actual audio file, the *.ra file.#  You can then use "wget" or something similar#+ to download the *.ra file itself.#  Exercises:#  ---------#  As is, this script converts only *.ra filenames.#  Add flexibility by permitting use of *.ram and other filenames.##  If you're really ambitious, expand the script#+ to do automatic downloads and conversions of streaming audio files.#  Given a URL, batch download streaming audio files (using "wget")#+ and convert them.

⌨️ 快捷键说明

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