1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-05-20 10:53:23 -07:00
rc/home/streamcrap

110 lines
3.3 KiB
Plaintext
Raw Normal View History

2015-12-11 01:06:01 -08:00
#!/bin/zsh
# awful things
2018-02-20 02:56:10 -08:00
MPV_STREAM_FLAGS="--quiet --autofit=1280x720 --loop-playlist=no --no-resume-playback --no-sub \
2018-02-25 03:35:22 -08:00
--no-initial-audio-sync --mc=0.02 --autosync=30"
#--cache-secs=10 --cache-initial=1024 --cache-pause --cache-backbuffer=0 --cache-seek-min=2048"
2015-12-11 01:06:01 -08:00
_M_STEREO='aformat=channel_layouts=stereo'
_M_PRE_EMPH='equalizer=f=50.0:g=-10:width_type=o:w=4,equalizer=f=5000:g=+05:width_type=o:w=4'
_M_POST_EMPH='equalizer=f=50.0:g=+10:width_type=o:w=4,equalizer=f=5000:g=-05:width_type=o:w=4'
_M_COMPRESS='compand=0.001|0.001:0.25|0.25:-42/-42|0/-21:6:18:-30:0.001'
2016-05-08 15:28:38 -07:00
_M_COMPRESS_SOFT='acompressor=threshold=0.01:ratio=1.667:attack=50:release=3200:makeup=6.7:knee=8:mix=0.67'
2015-12-11 01:06:01 -08:00
_M_KILL="$_M_STEREO,$_M_PRE_EMPH,$_M_COMPRESS,$_M_POST_EMPH"
2018-08-03 20:45:41 -07:00
_M_MULTI="volume=10,mcompand=0.256\,2.56 9 -90/-90\,-44/-44\,0/-26.4\,20/0 80 0 -44 0 | 0.128\,1.28 9 -90/-90\,-36/-36\,0/-18\,20/0 160 0 -36 0 | 0.064\,0.64 9 -90/-90\,-37/-37\,0/-18.5\,20/0 320 0 -37 0 | 0.032\,0.32 9 -90/-90\,-38/-38\,0/-19\,20/0 640 0 -38 0 | 0.016\,0.16 9 -90/-90\,-40/-40\,0/-20\,20/0 1280 0 -40 0 | 0.008\,0.08 9 -90/-90\,-41/-41\,0/-20.5\,20/0 2560 0 -41 0 | 0.004\,0.04 9 -90/-90\,-44/-44\,0/-22\,20/0 5120 0 -44 0 | 0.002\,0.02 9 -90/-90\,-52/-52\,0/-26\,20/0 10240 0 -52 0 | 0.001\,0.01 9 -90/-90\,-60/-60\,0/-36\,20/0 20480 0 -60 0"
2015-12-11 01:06:01 -08:00
getladspa() {
2016-02-24 14:10:31 -08:00
REPLY="volume"
2015-12-11 01:06:01 -08:00
if [ -e "/usr/lib/ladspa/${1}.so" ]; then
2015-12-11 06:30:03 -08:00
REPLY="ladspa=f=${1}:p=${1}"
2015-12-11 01:06:01 -08:00
fi
}
2015-12-18 18:59:30 -08:00
getladspa crap_level
2015-12-11 01:06:01 -08:00
_M_LEVEL="$REPLY"
2016-01-01 18:40:37 -08:00
_nn="$(uname -n | tr A-Z a-z)"
2016-02-06 12:17:18 -08:00
2017-03-13 05:17:24 -07:00
earphones() {
2018-02-20 02:56:10 -08:00
_M_PROCESS="lowpass=8000:p=1,$_M_KILL,alimiter=level_out=0.707"
2017-03-13 05:17:24 -07:00
}
2016-01-01 18:40:37 -08:00
if [[ "$_nn" == "spectre" ]]; then
2017-03-19 08:30:46 -07:00
_M_PROCESS="$_M_KILL,alimiter=level_out=0.7071"
fi
if [[ "$_nn" == "neobanshee" ]]; then
speakers() {
_M_PROCESS="highpass=311,$_M_KILL,\
equalizer=700:o:1.3:-5,\
equalizer=1200:o:1.3:-3,\
equalizer=1090:o:0.5:-5,\
equalizer=970:o:1.2:-10,\
equalizer=4100:o:0.3:-6,\
alimiter=level_in=2"
2017-03-19 08:30:46 -07:00
}
speakers
2015-12-11 01:06:01 -08:00
fi
2016-01-01 18:40:37 -08:00
if [[ "$_nn" == "banshee" ]]; then
2018-02-20 02:56:10 -08:00
getladspa crap_eq_const_T420
_M_SPEAKERS="$REPLY"
2017-03-19 08:30:46 -07:00
speakers() {
_M_PROCESS="$_M_LEVEL,$_M_SPEAKERS,alimiter=level_in=0.5"
}
2017-03-13 05:17:24 -07:00
speakers
2015-12-11 01:06:01 -08:00
fi
2016-02-06 12:17:18 -08:00
_mpv_flags() {
REPLY="$MPV_STREAM_FLAGS --af=lavfi=[$_M_PROCESS]"
}
2018-02-20 02:56:10 -08:00
watchstream() {
pushd ~/play >/dev/null
2015-12-11 01:06:01 -08:00
local url="$1"
shift
2016-02-06 12:17:18 -08:00
_mpv_flags
2015-12-11 01:16:38 -08:00
if [ -n "$ZSH_VERSION" ]; then
# zsh syntax
2016-04-14 08:16:00 -07:00
mpv $=REPLY "$@" "$url"
2015-12-11 01:16:38 -08:00
else
# bash syntax
2016-04-14 08:16:00 -07:00
mpv $REPLY "$@" "$url"
2015-12-11 01:16:38 -08:00
fi
popd >/dev/null
2015-12-11 01:06:01 -08:00
}
twitch() {
local user="$1"
shift
watchstream "http://twitch.tv/$user" "$@"
2015-12-11 01:06:01 -08:00
}
2016-03-12 09:32:57 -08:00
yt() {
2016-05-08 15:28:38 -07:00
pushd ~/play >/dev/null
2016-03-12 09:32:57 -08:00
local vid="$1"
2018-03-13 01:38:15 -07:00
shift
if [[ ! -e "$vid" && "$(expr substr "$vid" 1 4)" != "http" ]]; then
2017-10-06 05:33:02 -07:00
vid="ytdl://$vid"
2016-03-12 09:32:57 -08:00
fi
mpv --af=lavfi="[$_M_PROCESS]" \
--audio-samplerate=44100 --audio-format=s16 \
2018-07-20 19:56:30 -07:00
--ytdl-format '[width<=1280],best' "$vid" "$@"
2016-05-08 15:28:38 -07:00
popd >/dev/null
2016-03-12 09:32:57 -08:00
}
2017-10-06 05:33:02 -07:00
ytg() {
yt "$@" --ytdl-format=95,best
}
2017-10-05 03:12:32 -07:00
ai() {
2018-02-20 02:56:10 -08:00
# hai domo
2017-10-05 03:12:32 -07:00
yt "$@" --slang=en --sub-font='Tekton Pro' --sub-bold=yes \
--sub-font-size=60 --sub-border-color='#DD6180' --sub-margin-y=52
}
2018-03-21 04:04:55 -07:00
asmr() {
2018-07-20 19:56:30 -07:00
_M_PROCESS="acompressor=threshold=0.0032:ratio=1.414:attack=17:release=640:makeup=6:knee=8:mix=0.8,alimiter=level_in=1.414:level_out=0.707" \
yt "$@" --volume=90 --ytdl-format=251,best
2018-03-21 04:04:55 -07:00
}
2016-02-06 12:17:18 -08:00
_nn=