I have been using the following command (answer by user confetti to a question on redirect sound (microphone) via ssh, how to telephone via ssh?) to ssh to another laptop on the other end of the house to listen in to prayer services held during lockdown while working!
ssh @ "arecord -f S16_LE -r 36000" | aplay
The laptop I'm connecting to however has a loud fan sound that comes through so I wanted to rather ssh into an android phone which has a better microphone as well as no fan sound. In addition the laptop is old and gets heated and shuts down often!
I installed an ssh server onto the android device and can ssh into it. However when I use the command
ssh admin@ -p 2222 "arecord -f S16_LE -r 36000" | aplay
I get the error:
bash: arecord: command not found
aplay: playback:2787: read error
Any advice/solution will be greatly appreciated.