Last active
August 14, 2018 06:37
-
-
Save zeuxisoo/f549d7d67010d15f0cfa3e5da04f5716 to your computer and use it in GitHub Desktop.
Start the radio stream in IINA application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# =========================================== | |
# Find output-device: mpv --audio-device=help | |
# =========================================== | |
IINA_CLI="/Applications/IINA.app/Contents/MacOS/iina-cli" | |
OUTPUT_DEVICE="coreaudio/AppleHDAEngineOutputDP:3,0,1,1:0:{0C41-C0C6-00000F4C}" | |
VOLUME=65 | |
function play { | |
RADIO_URL=$1 | |
$IINA_CLI $RADIO_URL --mpv-audio-device=$OUTPUT_DEVICE --mpv-volume=$VOLUME | |
} | |
COMMAND=${@:$OPTIND:1} | |
case $COMMAND in | |
rthk1) | |
play "http://rthk.hk/live1.m3u" | |
;; | |
rthk2) | |
play "http://rthk.hk/live2.m3u" | |
;; | |
997) | |
play "http://metroradio-lh.akamaihd.net/i/997_h@349799/master.m3u8" | |
;; | |
881) | |
play "http://d2agljdoug3z0j.cloudfront.net/radio-HTTP/cr1-hd.3gp/chunklist.m3u8" | |
;; | |
903) | |
play "http://d2agljdoug3z0j.cloudfront.net/radio-HTTP/cr2-hd.3gp/chunklist.m3u8" | |
;; | |
*) | |
echo "Radio List" | |
echo "----------" | |
echo "- rthk1" | |
echo "- rthk2" | |
echo "- 997" | |
echo "- 881" | |
echo "- 903" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment