📄 ra2ogg.sh
字号:
#!/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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -