Permalink
Browse files

2017年 8月 15日 火曜日 15:27:50 JST

  • Loading branch information...
tknr
tknr committed Aug 15, 2017
1 parent fc67adb commit 582b2f9a4a4b0976f6f1f88bc1d4d1a3d88e0f38
Showing with 8 additions and 7 deletions.
  1. +8 −7 convert_to_mp3.sh
View
@@ -13,6 +13,7 @@ if [ $# -eq 0 ]; then
exit 1 exit 1
fi fi
LAME_OPTION="-h -q 0 --preset insane --highpass -1 --lowpass -1"
TMP_DIR=/var/tmp/crond TMP_DIR=/var/tmp/crond
for TARGET_DIR in ${argv} for TARGET_DIR in ${argv}
@@ -22,7 +23,7 @@ do
for FILENAME in `find "${TARGET_DIR}" -name "*.wav" | sort` for FILENAME in `find "${TARGET_DIR}" -name "*.wav" | sort`
do do
echo "${FILENAME}" echo "${FILENAME}"
lame -h -q 0 --preset insane --highpass -1 --lowpass -1 "${FILENAME}" "${FILENAME%%.wav}.mp3" || continue lame ${LAME_OPTION} "${FILENAME}" "${FILENAME%%.wav}.mp3" || continue
rm -f "${FILENAME}" || continue rm -f "${FILENAME}" || continue
done done
@@ -63,7 +64,7 @@ do
tags="Setting id3 tag info. Artist: [$artist] Album: [$album] Title: [$title] Year: [$mydate] Track: [$track] Genre: [$genre] Comment: [$comment]" tags="Setting id3 tag info. Artist: [$artist] Album: [$album] Title: [$title] Year: [$mydate] Track: [$track] Genre: [$genre] Comment: [$comment]"
echo $tags echo $tags
lame -h -q 0 --preset insane --highpass -1 --lowpass -1 --add-id3v2 --tt "$title" --ta "$artist" --tl "$album" --ty "$mydate" --tn "$track" --tg "${genre:-12}" --tc ${comment}"" "${TMP_DIR}/$serial.wav" "$i.mp3" || continue lame ${LAME_OPTION} --add-id3v2 --tt "$title" --ta "$artist" --tl "$album" --ty "$mydate" --tn "$track" --tg "${genre:-12}" --tc ${comment}"" "${TMP_DIR}/$serial.wav" "$i.mp3" || continue
rm -f "$id3" rm -f "$id3"
rm -f "${TMP_DIR}/$serial.wav" rm -f "${TMP_DIR}/$serial.wav"
@@ -94,7 +95,7 @@ do
tags="Setting id3 tag info. Artist: [$artist] Album: [$album] Title: [$title] Year: [$mydate] Track: [$track]" tags="Setting id3 tag info. Artist: [$artist] Album: [$album] Title: [$title] Year: [$mydate] Track: [$track]"
echo $tags echo $tags
lame -h -q 0 --preset insane --highpass -1 --lowpass -1 --add-id3v2 --tt "$title" --ta "$artist" --tl "$album" --ty "$mydate" --tn "$track" --tg "${genre:-12}" "${TMP_DIR}/$serial.wav" "$i.mp3" || continue lame ${LAME_OPTION} --add-id3v2 --tt "$title" --ta "$artist" --tl "$album" --ty "$mydate" --tn "$track" --tg "${genre:-12}" "${TMP_DIR}/$serial.wav" "$i.mp3" || continue
rm -f "$id3" rm -f "$id3"
rm -f "${TMP_DIR}/${serial}.wav" rm -f "${TMP_DIR}/${serial}.wav"
@@ -130,7 +131,7 @@ do
tags="Setting id3 tag info. Artist: [$artist] Album: [$album] Title: [$title] Year: [$mydate] Track: [$track] Comment: [$comment]" tags="Setting id3 tag info. Artist: [$artist] Album: [$album] Title: [$title] Year: [$mydate] Track: [$track] Comment: [$comment]"
echo $tags echo $tags
lame -h -q 0 --preset insane --highpass -1 --lowpass -1 --add-id3v2 --tt "$title" --ta "$artist" --tl "$album" --ty "$mydate" --tn "$track" --tc "${comment}" "${TMP_DIR}/$serial.wav" "$i.mp3" || continue lame ${LAME_OPTION} --add-id3v2 --tt "$title" --ta "$artist" --tl "$album" --ty "$mydate" --tn "$track" --tc "${comment}" "${TMP_DIR}/$serial.wav" "$i.mp3" || continue
rm -f "$id3" rm -f "$id3"
rm -f "${TMP_DIR}/$serial.wav" rm -f "${TMP_DIR}/$serial.wav"
@@ -144,7 +145,7 @@ for FILENAME in `find "${TARGET_DIR}" -name "*.aif" | sort`
do do
echo "${FILENAME}" echo "${FILENAME}"
i=${FILENAME%%.aif} i=${FILENAME%%.aif}
lame -h -q 0 --preset insane --highpass -1 --lowpass -1 "${FILENAME}" "${FILENAME%%.aif}.mp3" || continue lame ${LAME_OPTION} "${FILENAME}" "${FILENAME%%.aif}.mp3" || continue
rm -f "${FILENAME}" rm -f "${FILENAME}"
done done
@@ -153,7 +154,7 @@ for FILENAME in `find "${TARGET_DIR}" -name "*.aiff" | sort`
do do
echo "${FILENAME}" echo "${FILENAME}"
i=${FILENAME%%.aiff} i=${FILENAME%%.aiff}
lame -h -q 0 --preset insane --highpass -1 --lowpass -1 "${FILENAME}" "${FILENAME%%.aiff}.mp3" || continue lame ${LAME_OPTION} "${FILENAME}" "${FILENAME%%.aiff}.mp3" || continue
rm -f "${FILENAME}" rm -f "${FILENAME}"
done done
@@ -164,7 +165,7 @@ do
i=${FILENAME%%.mpc} i=${FILENAME%%.mpc}
serial=`uuidgen` serial=`uuidgen`
mpcdec "${FILENAME}" "${TMP_DIR}/${serial}.wav" || continue mpcdec "${FILENAME}" "${TMP_DIR}/${serial}.wav" || continue
lame -h -q 0 --preset insane --highpass -1 --lowpass -1 "${TMP_DIR}/${serial}.wav" "${i}.mp3" || continue lame ${LAME_OPTION} "${TMP_DIR}/${serial}.wav" "${i}.mp3" || continue
rm -f "${TMP_DIR}/${serial}.wav" rm -f "${TMP_DIR}/${serial}.wav"
rm -f "${FILENAME}" rm -f "${FILENAME}"
done done

0 comments on commit 582b2f9

Please sign in to comment.