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
22 ==========
33
44 **split2flac** splits one big APE/FLAC/TTA/WV/WAV audio image (or a collection of such files, recursively) with CUE sheet
5−into FLAC/M4A/MP3/OGG_VORBIS/WAV tracks with tagging, renaming, charset conversion of cue sheet, album cover images.
5+into FLAC/M4A/MP3/OGG_VORBIS/OPUS/WAV tracks with tagging, renaming, charset conversion of cue sheet, album cover images.
66 It also uses configuration file, so no need to pass a lot of arguments every time, only an input file.
77 Should work in any POSIX-compliant shell.
88
@@ -17,6 +17,7 @@ Manual installation · 8 unmodified lines
1717 cd /usr/bin # this is a directory where split2flac was installed
1818 ln -s split2flac split2mp3
1919 ln -s split2flac split2ogg
20+ ln -s split2flac split2opus
2021 ln -s split2flac split2m4a
2122 ln -s split2flac split2wav
2223
@@ -38,6 +39,7 @@ Dependencies · 15 unmodified lines
3839 * **enca** to automatically detect charset if it's not UTF8
3940 * **lame** and **id3lib** (or better **mutagen** for Unicode tags) to split into MP3
4041 * **vorbis-tools** to split into OGG VORBIS
42+ * **opus-tools** to split into OPUS
4143
4244 * Replay Gain:
4345 * **flac** for FLAC Replay Gain support
split2flac+20−3
@@ -57,6 +57,7 @@ ENCARGS_flac="-8" · 56 unmodified lines
5757 ENCARGS_m4a="-q 500"
5858 ENCARGS_mp3="--preset standard"
5959 ENCARGS_ogg="-q 5"
60+ENCARGS_opus=""
6061 ENCARGS_wav=""
6162
6263 # load settings
@@ -71,7 +72,7 @@ FORCE=0 · 8 unmodified lines
7172 VERSION=122
7273
7374 HELP="\${cG}split2flac version: ${VERSION}
74−Splits 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.
75+Splits 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.
7576
7677 Usage: \${cZ}split2\${FORMAT} [\${cU}OPTIONS\$cZ] \${cU}FILE\$cZ [\${cU}OPTIONS\$cZ]\$cZ
7778 \${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
105106
106107 \$cR*\$cZ - option affects configuration if \$cP'-s'\$cZ option passed.
107108 \${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.
109110 Supported tags for \$cU\${cG}PATTERN\${cZ}: @artist, @album, @year, @track, @performer, @title, @genre, @ext.
110111 @performer tag is useful with 'various artists' albums, when you want to add
111112 each 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
187188 mac 2>&1 | grep '(v ';
188189 faac -h 2>&1 | grep '^FAAC';
189190 oggenc --version 2>/dev/null;
191+ opusenc --version 2>/dev/null;
190192 lame --version | grep '^LAME';
191193 exit 0;;
192194 -*) eval "$msg \"${HELP}\""; emsg "\nUnknown option $1\n"; exit 1;;
@@ -223,6 +225,7 @@ if [ ${SAVE} -eq 1 ]; then · 30 unmodified lines
223225 echo "ENCARGS_m4a=\"${ENCARGS_m4a}\"" >> "${CONFIG}"
224226 echo "ENCARGS_mp3=\"${ENCARGS_mp3}\"" >> "${CONFIG}"
225227 echo "ENCARGS_ogg=\"${ENCARGS_ogg}\"" >> "${CONFIG}"
228+ echo "ENCARGS_opus=\"${ENCARGS_opus}\"" >> "${CONFIG}"
226229 echo "ENCARGS_wav=\"${ENCARGS_wav}\"" >> "${CONFIG}"
227230 echo "ENCA_ARGS=\"${ENCA_ARGS}\"" >> "${CONFIG}"
228231 $msg "${cP}Configuration saved$cZ\n"
@@ -245,6 +248,7 @@ case ${FORMAT} in · 16 unmodified lines
245248 m4a) $msg "$msg_format M4A"; enc_help="faac --help";;
246249 mp3) $msg "$msg_format MP3"; enc_help="lame --help";;
247250 ogg) $msg "$msg_format OGG VORBIS"; enc_help="oggenc --help";;
251+ opus) $msg "$msg_format OPUS"; enc_help="opusenc --help";;
248252 wav) $msg "$msg_format WAVE"; enc_help="echo Sorry, no arguments available for this encoder";;
249253 *) emsg "Unknown output format \"${FORMAT}\"\n"; exit 1;;
250254 esac
@@ -506,6 +510,7 @@ split_file () { · 255 unmodified lines
506510 m4a) ENC="cust ext=m4a faac ${ENCARGS} -o %f -"; RG="aacgain";;
507511 mp3) ENC="cust ext=mp3 lame ${ENCARGS} - %f"; RG="mp3gain";;
508512 ogg) ENC="cust ext=ogg oggenc ${ENCARGS} - -o %f"; RG="vorbisgain -a";;
513+ opus) ENC="cust ext=opus opusenc ${ENCARGS} - %f"; REPLAY_GAIN=0;;
509514 wav) ENC="wav ${ENCARGS}"; REPLAY_GAIN=0;;
510515 *) emsg "Unknown output format ${FORMAT}\n"; exit 1;;
511516 esac
@@ -585,7 +590,7 @@ split_file () { · 73 unmodified lines
585590 ${ID3TAG} --artist="${TAG_PERFORMER}" \
586591 --album="${TAG_ALBUM}" \
587592 --song="${TAG_TITLE}" \
588− --track="$i" \
593+ --track="$i/${TRACKS_NUM}" \
589594 "${FINAL}" >/dev/null
590595 RES=$?
591596
@@ -606,6 +611,18 @@ split_file () { · 14 unmodified lines
606611 [ "${TAG_DATE}" ] && { ${VORBISCOMMENT} "${FINAL}" -t "DATE=${TAG_DATE}" >/dev/null; RES=$RES$?; }
607612 ;;
608613
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+
609626 m4a)
610627 ${MP4TAGS} "${FINAL}" \
611628 -a "${TAG_PERFORMER}" \
split2flac-bash-completion.sh+1−1
@@ -6,7 +6,7 @@ _split2flac () { · 5 unmodified lines
66 _get_comp_words_by_ref cur prev
77
88 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"
1010
1111 if [[ ${cur} == -* ]] ; then
1212 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