mirror of
https://github.com/notwa/rc
synced 2024-06-26 01:07:11 -07:00
why am i doing this
This commit is contained in:
parent
4dc81b47e6
commit
dbff418317
|
@ -105,14 +105,17 @@ function trash() {
|
||||||
. ~/sh/z/z.sh
|
. ~/sh/z/z.sh
|
||||||
|
|
||||||
MPV_STREAM_FLAGS="--quiet --no-sub"
|
MPV_STREAM_FLAGS="--quiet --no-sub"
|
||||||
LIVESTREAMER_FLAGS=""
|
[ -e "$HOME/sh/compandy" ] && _MPV_COMPAND="$(~/sh/compandy -30 10 1 140 6 18 1)"
|
||||||
|
_MPV_LAPTOP='--af=lavfi=[aformat=channel_layouts=stereo,'"$_MPV_COMPAND"',lowpass=f=1000:p=1,lowpass=f=4000:p=2]'
|
||||||
|
|
||||||
if [[ "$(uname -n)" != "banshee" ]]; then
|
if [[ "$(uname -n)" != "banshee" ]]; then
|
||||||
MPV_STREAM_FLAGS="$MPV_STREAM_FLAGS --vo=opengl:swapinterval=0"
|
MPV_STREAM_FLAGS="$MPV_STREAM_FLAGS --vo=opengl:swapinterval=0"
|
||||||
else
|
else
|
||||||
_COMPAND="$(~/sh/compandy 1 140 -30 10 6 18 1)"
|
MPV_STREAM_FLAGS="$MPV_STREAM_FLAGS $_MPV_LAPTOP"
|
||||||
MPV_STREAM_FLAGS="$MPV_STREAM_FLAGS "'--af=lavfi=\"aformat=channel_layouts=stereo,'"$_COMPAND"',lowpass=f=1000:p=1,lowpass=f=4000:p=2\"'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
LIVESTREAMER_FLAGS=""
|
||||||
|
|
||||||
twitch(){
|
twitch(){
|
||||||
livestreamer "twitch.tv/$1" best -p mpv $LIVESTREAMER_FLAGS -a \
|
livestreamer "twitch.tv/$1" best -p mpv $LIVESTREAMER_FLAGS -a \
|
||||||
"$MPV_STREAM_FLAGS ${2:+--autofit=}${2:-} {filename}"
|
"$MPV_STREAM_FLAGS ${2:+--autofit=}${2:-} {filename}"
|
||||||
|
|
13
sh/compandy
13
sh/compandy
|
@ -2,20 +2,19 @@
|
||||||
# script to make sense of compand's parameters
|
# script to make sense of compand's parameters
|
||||||
compandy() {
|
compandy() {
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
echo -E "usage: $0 {attack} {release} {threshold} {ratio} [knee] [gain] [delay]"
|
echo -E "usage: $0 {threshold} {ratio} [attack] [release] [knee] [gain] [delay]"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
local atk="${1}" rel="${2}"
|
local thresh="${1:-10}" ratio="${2:-2}"
|
||||||
local thresh="${3}" ratio="${4}"
|
local atk="${3:-1}" rel="${4:-100}"
|
||||||
local knee="${5:-1}" gain="${6:-0}" delay="${7:-0}"
|
local knee="${5:-1}" gain="${6:-0}" delay="${7:-0}"
|
||||||
let 'atk/=1000.'
|
let 'atk/=1000.'
|
||||||
let 'rel/=1000.'
|
let 'rel/=1000.'
|
||||||
let 'delay/=1000.'
|
let 'delay/=1000.'
|
||||||
local end= start=
|
local end= start=
|
||||||
let 'end=thresh - thresh/(ratio + 0.0)'
|
let 'end=thresh - thresh/(ratio + 0.0)'
|
||||||
local start=$thresh
|
let 'start=thresh'
|
||||||
printf "compand=%.5f|%.5f:%.5f|%.5f:%.1f/%.1f|0/%.2f:%.2f:%.2f:%.1f" \
|
printf "compand=%.5f|%.5f:%.5f|%.5f:%.1f/%.1f|0/%.2f:%.2f:%.2f:%.1f:%.5f" \
|
||||||
$atk $atk $rel $rel $thresh $thresh $end $knee $gain $start
|
$atk $atk $rel $rel $thresh $thresh $end $knee $gain $start $delay
|
||||||
#echo "compand=$atk|$atk:$rel|$rel:$thresh/$thresh|0/$end:$knee:$gain:$start:$delay"
|
|
||||||
}
|
}
|
||||||
compandy "$@"
|
compandy "$@"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user