LoginSignup
0
0

More than 5 years have passed since last update.

いろいろめも

Last updated at Posted at 2016-11-24

前提

brew install flac lame shntool

CUE + FLAC to Splitted FLAC

shnsplit -f *.cue -t "%n %t" -o flac *.flac

FLAC to MP3

flac2mp3.sh
#!/bin/bash

for a in ./*.flac; do
  # give output correct extension
  OUTF="${a[@]/%flac/mp3}"

  # get the tags
  ARTIST=$(metaflac "$a" --show-tag=ARTIST | sed s/.*=//g)
  TITLE=$(metaflac "$a" --show-tag=TITLE | sed s/.*=//g)
  ALBUM=$(metaflac "$a" --show-tag=ALBUM | sed s/.*=//g)
  GENRE=$(metaflac "$a" --show-tag=GENRE | sed s/.*=//g)
  TRACKNUMBER=$(metaflac "$a" --show-tag=TRACKNUMBER | sed s/.*=//g)
  DATE=$(metaflac "$a" --show-tag=DATE | sed s/.*=//g)

  # stream flac into the lame encoder
  flac -c -d "$a" | lame -b 320 -q 0 --add-id3v2 --pad-id3v2 --ignore-tag-errors \
    --ta "$ARTIST" --tt "$TITLE" --tl "$ALBUM"  --tg "${GENRE:-12}" \
    --tn "${TRACKNUMBER:-0}" --ty "$DATE" - "$OUTF"
done

SVG to PDF

#!/bin/sh

for file in *.svg
do
  echo "${file} -> ${file}.pdf"
  inkscape --without-gui --file="${file}" --export-pdf="${file}.pdf"
done
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0