28 Dec 2020 (Mon)

10:15:56 # Life Quick and dirty way to send around audio via network. I wondered if there's a remote protocol for audio sending, but I realized there's a swiss army knife that works reasonably well for p-to-p. To obtain audio from alsa device I can use ecasound and send it out through stdout, then pipe using ssh, and play back on the other end. Should probably use something like rtmp when there's multiple end points but this works now... Raspberry pi sshd is at 14 percent CPU time with 16kHz monaural. Stereo 44.1k probably pushes it to the limit.

	  remote $ arecord --list-devices  # find the input device.
	  remote $ arecord -r 16000 -f S16_LE -D hw:1,0 /tmp/a.wav  # find the right format that the audio device supports.

	  $ ssh remote ecasound -B:nonrt -f 16,1,16000 -i alsahw,1,0 -o stdout|
	  ecasound -B:nonrt -f 16,1,16000 -i stdin  -erc:1,2 -f 16,2,16000 -o alsahw,0,0
	
Junichi Uekawa