rom1v / sndcpy

Android audio forwarding (scrcpy, but for audio)
MIT License
3.29k stars 303 forks source link

ANOTHER SOLUTION FOR MACOS USERS VLC NOT DETECTED #238

Open dbb13 opened 2 years ago

dbb13 commented 2 years ago

I saw this comment for a solution in macOS users and it didn't helped me a lot but it guided me to try to modify it a little bit.

this is the original=

!/bin/bash

set -e ADB=${ADB:-adb} VLC=${VLC:-vlc} SNDCPY_APK=${SNDCPY_APK:-sndcpy.apk} SNDCPY_PORT=${SNDCPY_PORT:-28200}

serial= if [[ $# -ge 1 ]] then serial="-s $1" echo "Waiting for device $1..." else echo 'Waiting for device...' fi

"$ADB" $serial wait-for-device adb install /Users/roushankumar/Documents/software/sndcpy-v1.0/sndcpy.apk echo 'Intall complete'

"$ADB" $serial forward tcp:$SNDCPY_PORT localabstract:sndcpy "$ADB" $serial shell am start com.rom1v.sndcpy/.MainActivity echo "Press Enter once audio capture is authorized on the device to start playing..." read dummy /Applications/VLC.app/Contents/MacOS/VLC --demux rawaud --network-caching=50 --play-and-exit tcp://localhost:"$SNDCPY_PORT" Above script working for MacOs

Originally posted by @roushan0102 in https://github.com/rom1v/sndcpy/issues/14#issuecomment-696615343

and what i did was something similar=


set -e
ADB=${ADB:-adb}
VLC=${VLC:-vlc}
SNDCPY_APK=${SNDCPY_APK:-sndcpy.apk}
SNDCPY_PORT=${SNDCPY_PORT:-28200}

serial=
if [[ $# -ge 1 ]]
then
    serial="-s $1"
    echo "Waiting for device $1..."
else
    echo 'Waiting for device...'
fi

"$ADB" $serial wait-for-device
"$ADB" $serial install -t -r "$SNDCPY_APK" ||
{
    echo 'Uninstalling existing version first...'
    "$ADB" $serial uninstall com.rom1v.sndcpy
    "$ADB" $serial install -t -g "$SNDCPY_APK"
}

"$ADB" $serial shell appops set com.rom1v.sndcpy PROJECT_MEDIA allow
"$ADB" $serial forward tcp:$SNDCPY_PORT localabstract:sndcpy
"$ADB" $serial shell am start com.rom1v.sndcpy/.MainActivity
echo "Press Enter once audio capture is authorized on the device to start playing..."
read dummy
/Applications/VLC.app/Contents/MacOS/VLC --demux rawaud --network-caching=50 --play-and-exit tcp://localhost:"$SNDCPY_PORT"´´´

and ultimately had to restart the terminal and vlc like two times bc the first I wrote something wrong. If this one helps let me know.