mirror of
https://github.com/rom1v/sndcpy.git
synced 2025-02-18 21:43:34 +03:00
32 lines
1.0 KiB
Batchfile
Executable File
32 lines
1.0 KiB
Batchfile
Executable File
@echo off
|
|
if not defined ADB set ADB=adb
|
|
if not defined VLC set VLC="C:\Program Files\VideoLAN\VLC\vlc.exe"
|
|
if not defined SNDCPY_APK set SNDCPY_APK=sndcpy.apk
|
|
if not defined SNDCPY_PORT set SNDCPY_PORT=28200
|
|
|
|
if not "%1"=="" (
|
|
set serial=-s %1
|
|
echo Waiting for device %1...
|
|
) else (
|
|
echo Waiting for device...
|
|
)
|
|
|
|
%ADB% %serial% wait-for-device || goto :error
|
|
%ADB% %serial% install -t -r -g %SNDCPY_APK% || (
|
|
echo Uninstalling existing version first...
|
|
%ADB% %serial% uninstall com.rom1v.sndcpy || goto :error
|
|
%ADB% %serial% install -t -g %SNDCPY_APK% || goto :error
|
|
)
|
|
%ADB% %serial% forward tcp:%SNDCPY_PORT% localabstract:sndcpy || goto :error
|
|
%ADB% %serial% shell am start com.rom1v.sndcpy/.MainActivity || goto :error
|
|
echo Press Enter once audio capture is authorized on the device to start playing...
|
|
pause >nul
|
|
echo Playing audio...
|
|
%VLC% -Idummy --demux rawaud --network-caching=0 --play-and-exit tcp://localhost:%SNDCPY_PORT%
|
|
goto :EOF
|
|
|
|
:error
|
|
echo Failed with error #%errorlevel%.
|
|
pause
|
|
exit /b %errorlevel%
|