mirror of
https://github.com/Phantop/dotfiles
synced 2024-11-16 20:02:47 +00:00
25 lines
608 B
Bash
Executable file
25 lines
608 B
Bash
Executable file
#!/bin/sh
|
|
HIFI=~/Music/HiFi
|
|
LOFI=/tmp/foo
|
|
test -f /usr/share/man/man3/Parallel::ForkManager.3pm || sudo eopkg it perl-parallel-forkmanager
|
|
|
|
if test $# -eq 0; then
|
|
mkdir "$LOFI"
|
|
fusermount -u "$LOFI"
|
|
ifuse --documents com.foobar2000.mobile "$LOFI" || exit 1
|
|
else
|
|
LOFI=$1
|
|
fi
|
|
|
|
if ! test -d "$LOFI"; then
|
|
cd "$HIFI" || exit 1
|
|
fd -t d -x mkdir -p "$LOFI"/{}
|
|
fd -e flac -x opusenc --bitrate 128 {} "$LOFI"/'{.}'.opus
|
|
fi
|
|
|
|
# https://github.com/smxi/acxi/raw/stable/acxi
|
|
acxi -s "$HIFI" -d "$LOFI" -o opus -q 128 --clean sync -F 16 -c mp3,m4a,opus,ogg
|
|
|
|
fusermount -u "$LOFI"
|
|
rmdir "$LOFI"
|