2022-04-13 21:24:16 +00:00
|
|
|
#!/bin/sh
|
|
|
|
HIFI=~/Music/HiFi
|
|
|
|
LOFI=/tmp/foo
|
2022-11-13 20:22:41 +00:00
|
|
|
test -f /usr/share/man/man3/Parallel::ForkManager.3pm || sudo eopkg it perl-parallel-forkmanager
|
2021-01-07 14:23:59 +00:00
|
|
|
|
2022-04-13 21:24:16 +00:00
|
|
|
if test $# -eq 0; then
|
|
|
|
mkdir "$LOFI"
|
|
|
|
fusermount -u "$LOFI"
|
|
|
|
ifuse --documents com.foobar2000.mobile "$LOFI"
|
2021-12-04 20:53:41 +00:00
|
|
|
else
|
2022-04-13 21:24:16 +00:00
|
|
|
LOFI=$1
|
|
|
|
fi
|
2021-03-27 22:37:14 +00:00
|
|
|
|
2022-04-13 21:24:16 +00:00
|
|
|
if ! test -d "$LOFI"; then
|
|
|
|
cd "$HIFI" || exit 1
|
|
|
|
fd -t d -x mkdir -p "$LOFI"/{}
|
|
|
|
fd -e flac -x opusenc --bitrate 256 {} "$LOFI"/'{.}'.opus
|
|
|
|
fi
|
2021-01-07 14:23:59 +00:00
|
|
|
|
2022-04-13 21:24:16 +00:00
|
|
|
# https://github.com/smxi/acxi/raw/stable/acxi
|
|
|
|
acxi -s "$HIFI" -d "$LOFI" -o opus -q 256 --clean sync -F 16 -c mp3,m4a,opus
|
2021-03-27 22:37:14 +00:00
|
|
|
|
2022-04-13 21:24:16 +00:00
|
|
|
fusermount -u "$LOFI"
|
|
|
|
rmdir "$LOFI"
|