Unified · Split
| @@ -57,6 +57,7 @@ ENCARGS_flac="-8" · 56 unmodified lines | ||
| 57 | 57 | ENCARGS_m4a="-q 500" |
| 58 | 58 | ENCARGS_mp3="--preset standard" |
| 59 | 59 | ENCARGS_ogg="-q 5" |
| 60 | +ENCARGS_opus="" | |
| 60 | 61 | ENCARGS_wav="" |
| 61 | 62 | |
| 62 | 63 | # load settings |
| @@ -71,7 +72,7 @@ FORCE=0 · 8 unmodified lines | ||
| 71 | 72 | VERSION=122 |
| 72 | 73 | |
| 73 | 74 | 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. | |
| 75 | 76 | |
| 76 | 77 | Usage: \${cZ}split2\${FORMAT} [\${cU}OPTIONS\$cZ] \${cU}FILE\$cZ [\${cU}OPTIONS\$cZ]\$cZ |
| 77 | 78 | \${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 | 107 | \$cR*\$cZ - option affects configuration if \$cP'-s'\$cZ option passed. |
| 107 | 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. | |
| 109 | 110 | Supported tags for \$cU\${cG}PATTERN\${cZ}: @artist, @album, @year, @track, @performer, @title, @genre, @ext. |
| 110 | 111 | @performer tag is useful with 'various artists' albums, when you want to add |
| 111 | 112 | each artist's name to the track filename. It works as @artist if track performer is undefined. |
| @@ -223,6 +224,7 @@ if [ ${SAVE} -eq 1 ]; then · 111 unmodified lines | ||
| 223 | 224 | echo "ENCARGS_m4a=\"${ENCARGS_m4a}\"" >> "${CONFIG}" |
| 224 | 225 | echo "ENCARGS_mp3=\"${ENCARGS_mp3}\"" >> "${CONFIG}" |
| 225 | 226 | echo "ENCARGS_ogg=\"${ENCARGS_ogg}\"" >> "${CONFIG}" |
| 227 | + echo "ENCARGS_opus=\"${ENCARGS_opus}\"" >> "${CONFIG}" | |
| 226 | 228 | echo "ENCARGS_wav=\"${ENCARGS_wav}\"" >> "${CONFIG}" |
| 227 | 229 | echo "ENCA_ARGS=\"${ENCA_ARGS}\"" >> "${CONFIG}" |
| 228 | 230 | $msg "${cP}Configuration saved$cZ\n" |
| @@ -245,6 +247,7 @@ case ${FORMAT} in · 16 unmodified lines | ||
| 245 | 247 | m4a) $msg "$msg_format M4A"; enc_help="faac --help";; |
| 246 | 248 | mp3) $msg "$msg_format MP3"; enc_help="lame --help";; |
| 247 | 249 | ogg) $msg "$msg_format OGG VORBIS"; enc_help="oggenc --help";; |
| 250 | + opus) $msg "$msg_format OPUS"; enc_help="opusenc --help";; | |
| 248 | 251 | wav) $msg "$msg_format WAVE"; enc_help="echo Sorry, no arguments available for this encoder";; |
| 249 | 252 | *) emsg "Unknown output format \"${FORMAT}\"\n"; exit 1;; |
| 250 | 253 | esac |
| @@ -506,6 +509,7 @@ split_file () { · 255 unmodified lines | ||
| 506 | 509 | m4a) ENC="cust ext=m4a faac ${ENCARGS} -o %f -"; RG="aacgain";; |
| 507 | 510 | mp3) ENC="cust ext=mp3 lame ${ENCARGS} - %f"; RG="mp3gain";; |
| 508 | 511 | ogg) ENC="cust ext=ogg oggenc ${ENCARGS} - -o %f"; RG="vorbisgain -a";; |
| 512 | + opus) ENC="cust ext=opus opusenc ${ENCARGS} - %f"; REPLAY_GAIN=0;; | |
| 509 | 513 | wav) ENC="wav ${ENCARGS}"; REPLAY_GAIN=0;; |
| 510 | 514 | *) emsg "Unknown output format ${FORMAT}\n"; exit 1;; |
| 511 | 515 | esac |
| @@ -585,7 +589,7 @@ split_file () { · 73 unmodified lines | ||
| 585 | 589 | ${ID3TAG} --artist="${TAG_PERFORMER}" \ |
| 586 | 590 | --album="${TAG_ALBUM}" \ |
| 587 | 591 | --song="${TAG_TITLE}" \ |
| 588 | − --track="$i" \ | |
| 592 | + --track="$i/${TRACKS_NUM}" \ | |
| 589 | 593 | "${FINAL}" >/dev/null |
| 590 | 594 | RES=$? |
| 591 | 595 | |
| @@ -606,6 +610,18 @@ split_file () { · 14 unmodified lines | ||
| 606 | 610 | [ "${TAG_DATE}" ] && { ${VORBISCOMMENT} "${FINAL}" -t "DATE=${TAG_DATE}" >/dev/null; RES=$RES$?; } |
| 607 | 611 | ;; |
| 608 | 612 | |
| 613 | + opus) | |
| 614 | + ${ID3TAG} --artist="${TAG_PERFORMER}" \ | |
| 615 | + --album="${TAG_ALBUM}" \ | |
| 616 | + --song="${TAG_TITLE}" \ | |
| 617 | + --track="$i/${TRACKS_NUM}" \ | |
| 618 | + "${FINAL}" >/dev/null | |
| 619 | + RES=$? | |
| 620 | + | |
| 621 | + [ "${TAG_GENRE}" ] && { ${ID3TAG} --genre="${TAG_GENRE}" "${FINAL}" >/dev/null; RES=$RES$?; } | |
| 622 | + [ "${TAG_DATE}" ] && { ${ID3TAG} --year="${TAG_DATE}" "${FINAL}" >/dev/null; RES=$RES$?; } | |
| 623 | + ;; | |
| 624 | + | |
| 609 | 625 | m4a) |
| 610 | 626 | ${MP4TAGS} "${FINAL}" \ |
| 611 | 627 | -a "${TAG_PERFORMER}" \ |