History

Merge pull request #29 from JustArchi/master

Add opus support

Sigrid committed 9 years ago

Commit 44a2ebd2 parents 9e5f019 8e0223a3 files · +24 −5Browse files

Unified · Split

3 files
  1. README.md +3 −1
  2. split2flac +20 −3
  3. split2flac-bash-completion.sh +1 −1
README.md+3−1
@@ -2,7 +2,7 @@ split2flac · 1 unmodified line
2==========2==========
3 3
4**split2flac** splits one big APE/FLAC/TTA/WV/WAV audio image (or a collection of such files, recursively) with CUE sheet4**split2flac** splits one big APE/FLAC/TTA/WV/WAV audio image (or a collection of such files, recursively) with CUE sheet
5into FLAC/M4A/MP3/OGG_VORBIS/WAV tracks with tagging, renaming, charset conversion of cue sheet, album cover images.5into FLAC/M4A/MP3/OGG_VORBIS/OPUS/WAV tracks with tagging, renaming, charset conversion of cue sheet, album cover images.
6It also uses configuration file, so no need to pass a lot of arguments every time, only an input file.6It also uses configuration file, so no need to pass a lot of arguments every time, only an input file.
7Should work in any POSIX-compliant shell.7Should work in any POSIX-compliant shell.
8 8
@@ -17,6 +17,7 @@ Manual installation · 8 unmodified lines
17 cd /usr/bin # this is a directory where split2flac was installed17 cd /usr/bin # this is a directory where split2flac was installed
18 ln -s split2flac split2mp318 ln -s split2flac split2mp3
19 ln -s split2flac split2ogg19 ln -s split2flac split2ogg
20 ln -s split2flac split2opus
20 ln -s split2flac split2m4a21 ln -s split2flac split2m4a
21 ln -s split2flac split2wav22 ln -s split2flac split2wav
22 23
@@ -38,6 +39,7 @@ Dependencies · 15 unmodified lines
38 * **enca** to automatically detect charset if it's not UTF839 * **enca** to automatically detect charset if it's not UTF8
39 * **lame** and **id3lib** (or better **mutagen** for Unicode tags) to split into MP340 * **lame** and **id3lib** (or better **mutagen** for Unicode tags) to split into MP3
40 * **vorbis-tools** to split into OGG VORBIS41 * **vorbis-tools** to split into OGG VORBIS
42 * **opus-tools** to split into OPUS
41 43
42 * Replay Gain:44 * Replay Gain:
43 * **flac** for FLAC Replay Gain support45 * **flac** for FLAC Replay Gain support
split2flac+20−3
@@ -57,6 +57,7 @@ ENCARGS_flac="-8" · 56 unmodified lines
57ENCARGS_m4a="-q 500"57ENCARGS_m4a="-q 500"
58ENCARGS_mp3="--preset standard"58ENCARGS_mp3="--preset standard"
59ENCARGS_ogg="-q 5"59ENCARGS_ogg="-q 5"
60ENCARGS_opus=""
60ENCARGS_wav=""61ENCARGS_wav=""
61 62
62# load settings63# load settings
@@ -71,7 +72,7 @@ FORCE=0 · 8 unmodified lines
71VERSION=12272VERSION=122
72 73
73HELP="\${cG}split2flac version: ${VERSION}74HELP="\${cG}split2flac version: ${VERSION}
74Splits one big \${cU}APE/FLAC/WV/WAV\$cZ\$cG audio image (or a collection) into \${cU}FLAC/M4A/MP3/OGG_VORBIS/WAV\$cZ\$cG tracks with tagging and renaming.75Splits one big \${cU}APE/FLAC/WV/WAV\$cZ\$cG audio image (or a collection) into \${cU}FLAC/M4A/MP3/OGG_VORBIS/OPUS/WAV\$cZ\$cG tracks with tagging and renaming.
75 76
76Usage: \${cZ}split2\${FORMAT} [\${cU}OPTIONS\$cZ] \${cU}FILE\$cZ [\${cU}OPTIONS\$cZ]\$cZ77Usage: \${cZ}split2\${FORMAT} [\${cU}OPTIONS\$cZ] \${cU}FILE\$cZ [\${cU}OPTIONS\$cZ]\$cZ
77 \${cZ}split2\${FORMAT} [\${cU}OPTIONS\$cZ] \${cU}DIR\$cZ [\${cU}OPTIONS\$cZ]\$cZ78 \${cZ}split2\${FORMAT} [\${cU}OPTIONS\$cZ] \${cU}DIR\$cZ [\${cU}OPTIONS\$cZ]\$cZ
@@ -105,7 +106,7 @@ Usage: \${cZ}split2\${FORMAT} [\${cU}OPTIONS\$cZ] \${cU}FILE\$cZ [\${cU}OPTIONS\ · 27 unmodified lines
105 106
106\$cR*\$cZ - option affects configuration if \$cP'-s'\$cZ option passed.107\$cR*\$cZ - option affects configuration if \$cP'-s'\$cZ option passed.
107\${cP}NOTE: \$cG'-c some_file.jpg -s'\$cP only \${cU}allows\$cZ\$cP cover images, it doesn't set a default one.108\${cP}NOTE: \$cG'-c some_file.jpg -s'\$cP only \${cU}allows\$cZ\$cP cover images, it doesn't set a default one.
108\${cZ}Supported \$cU\${cG}FORMATs\${cZ}: flac, m4a, mp3, ogg, wav.109\${cZ}Supported \$cU\${cG}FORMATs\${cZ}: flac, m4a, mp3, ogg, opus, wav.
109Supported tags for \$cU\${cG}PATTERN\${cZ}: @artist, @album, @year, @track, @performer, @title, @genre, @ext.110Supported tags for \$cU\${cG}PATTERN\${cZ}: @artist, @album, @year, @track, @performer, @title, @genre, @ext.
110@performer tag is useful with 'various artists' albums, when you want to add111@performer tag is useful with 'various artists' albums, when you want to add
111each artist's name to the track filename. It works as @artist if track performer is undefined.112each artist's name to the track filename. It works as @artist if track performer is undefined.
@@ -187,6 +188,7 @@ while [ "$1" ]; do · 75 unmodified lines
187 mac 2>&1 | grep '(v ';188 mac 2>&1 | grep '(v ';
188 faac -h 2>&1 | grep '^FAAC';189 faac -h 2>&1 | grep '^FAAC';
189 oggenc --version 2>/dev/null;190 oggenc --version 2>/dev/null;
191 opusenc --version 2>/dev/null;
190 lame --version | grep '^LAME';192 lame --version | grep '^LAME';
191 exit 0;;193 exit 0;;
192 -*) eval "$msg \"${HELP}\""; emsg "\nUnknown option $1\n"; exit 1;;194 -*) eval "$msg \"${HELP}\""; emsg "\nUnknown option $1\n"; exit 1;;
@@ -223,6 +225,7 @@ if [ ${SAVE} -eq 1 ]; then · 30 unmodified lines
223 echo "ENCARGS_m4a=\"${ENCARGS_m4a}\"" >> "${CONFIG}"225 echo "ENCARGS_m4a=\"${ENCARGS_m4a}\"" >> "${CONFIG}"
224 echo "ENCARGS_mp3=\"${ENCARGS_mp3}\"" >> "${CONFIG}"226 echo "ENCARGS_mp3=\"${ENCARGS_mp3}\"" >> "${CONFIG}"
225 echo "ENCARGS_ogg=\"${ENCARGS_ogg}\"" >> "${CONFIG}"227 echo "ENCARGS_ogg=\"${ENCARGS_ogg}\"" >> "${CONFIG}"
228 echo "ENCARGS_opus=\"${ENCARGS_opus}\"" >> "${CONFIG}"
226 echo "ENCARGS_wav=\"${ENCARGS_wav}\"" >> "${CONFIG}"229 echo "ENCARGS_wav=\"${ENCARGS_wav}\"" >> "${CONFIG}"
227 echo "ENCA_ARGS=\"${ENCA_ARGS}\"" >> "${CONFIG}"230 echo "ENCA_ARGS=\"${ENCA_ARGS}\"" >> "${CONFIG}"
228 $msg "${cP}Configuration saved$cZ\n"231 $msg "${cP}Configuration saved$cZ\n"
@@ -245,6 +248,7 @@ case ${FORMAT} in · 16 unmodified lines
245 m4a) $msg "$msg_format M4A"; enc_help="faac --help";;248 m4a) $msg "$msg_format M4A"; enc_help="faac --help";;
246 mp3) $msg "$msg_format MP3"; enc_help="lame --help";;249 mp3) $msg "$msg_format MP3"; enc_help="lame --help";;
247 ogg) $msg "$msg_format OGG VORBIS"; enc_help="oggenc --help";;250 ogg) $msg "$msg_format OGG VORBIS"; enc_help="oggenc --help";;
251 opus) $msg "$msg_format OPUS"; enc_help="opusenc --help";;
248 wav) $msg "$msg_format WAVE"; enc_help="echo Sorry, no arguments available for this encoder";;252 wav) $msg "$msg_format WAVE"; enc_help="echo Sorry, no arguments available for this encoder";;
249 *) emsg "Unknown output format \"${FORMAT}\"\n"; exit 1;;253 *) emsg "Unknown output format \"${FORMAT}\"\n"; exit 1;;
250esac254esac
@@ -506,6 +510,7 @@ split_file () { · 255 unmodified lines
506 m4a) ENC="cust ext=m4a faac ${ENCARGS} -o %f -"; RG="aacgain";;510 m4a) ENC="cust ext=m4a faac ${ENCARGS} -o %f -"; RG="aacgain";;
507 mp3) ENC="cust ext=mp3 lame ${ENCARGS} - %f"; RG="mp3gain";;511 mp3) ENC="cust ext=mp3 lame ${ENCARGS} - %f"; RG="mp3gain";;
508 ogg) ENC="cust ext=ogg oggenc ${ENCARGS} - -o %f"; RG="vorbisgain -a";;512 ogg) ENC="cust ext=ogg oggenc ${ENCARGS} - -o %f"; RG="vorbisgain -a";;
513 opus) ENC="cust ext=opus opusenc ${ENCARGS} - %f"; REPLAY_GAIN=0;;
509 wav) ENC="wav ${ENCARGS}"; REPLAY_GAIN=0;;514 wav) ENC="wav ${ENCARGS}"; REPLAY_GAIN=0;;
510 *) emsg "Unknown output format ${FORMAT}\n"; exit 1;;515 *) emsg "Unknown output format ${FORMAT}\n"; exit 1;;
511 esac516 esac
@@ -585,7 +590,7 @@ split_file () { · 73 unmodified lines
585 ${ID3TAG} --artist="${TAG_PERFORMER}" \590 ${ID3TAG} --artist="${TAG_PERFORMER}" \
586 --album="${TAG_ALBUM}" \591 --album="${TAG_ALBUM}" \
587 --song="${TAG_TITLE}" \592 --song="${TAG_TITLE}" \
588 --track="$i" \593 --track="$i/${TRACKS_NUM}" \
589 "${FINAL}" >/dev/null594 "${FINAL}" >/dev/null
590 RES=$?595 RES=$?
591 596
@@ -606,6 +611,18 @@ split_file () { · 14 unmodified lines
606 [ "${TAG_DATE}" ] && { ${VORBISCOMMENT} "${FINAL}" -t "DATE=${TAG_DATE}" >/dev/null; RES=$RES$?; }611 [ "${TAG_DATE}" ] && { ${VORBISCOMMENT} "${FINAL}" -t "DATE=${TAG_DATE}" >/dev/null; RES=$RES$?; }
607 ;;612 ;;
608 613
614 opus)
615 ${ID3TAG} --artist="${TAG_PERFORMER}" \
616 --album="${TAG_ALBUM}" \
617 --song="${TAG_TITLE}" \
618 --track="$i/${TRACKS_NUM}" \
619 "${FINAL}" >/dev/null
620 RES=$?
621
622 [ "${TAG_GENRE}" ] && { ${ID3TAG} --genre="${TAG_GENRE}" "${FINAL}" >/dev/null; RES=$RES$?; }
623 [ "${TAG_DATE}" ] && { ${ID3TAG} --year="${TAG_DATE}" "${FINAL}" >/dev/null; RES=$RES$?; }
624 ;;
625
609 m4a)626 m4a)
610 ${MP4TAGS} "${FINAL}" \627 ${MP4TAGS} "${FINAL}" \
611 -a "${TAG_PERFORMER}" \628 -a "${TAG_PERFORMER}" \
split2flac-bash-completion.sh+1−1
@@ -6,7 +6,7 @@ _split2flac () { · 5 unmodified lines
6 _get_comp_words_by_ref cur prev6 _get_comp_words_by_ref cur prev
7 7
8 opts="-p -o -of -cue -cuecharset -nask -f -e -eh -enca -c -nc -C -nC -cs -d -nd -D -nD -F -colors -nocolors -g -ng -s -h -v"8 opts="-p -o -of -cue -cuecharset -nask -f -e -eh -enca -c -nc -C -nC -cs -d -nd -D -nD -F -colors -nocolors -g -ng -s -h -v"
9 formats="flac m4a mp3 ogg wav"9 formats="flac m4a mp3 ogg opus wav"
10 10
11 if [[ ${cur} == -* ]] ; then11 if [[ ${cur} == -* ]] ; then
12 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )12 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t