0

I am trying to redirect sound from a microphone from one computer to another in my local network. I did following to achieve that

In one terminal:

arecord -t raw -c 2 -f S16_LE -r 48000 | nc -u #IP_ADDRESS# 8080

In another terminal:

nc -u -l -p 8080 | aplay -t raw -c 2 -f S16_LE -r 48000

However, this attempt did not result as I expected. How can I achieve redirecting sound from a microphone from one computer to another using the command-line tools a typical Linux distro has?

0

From the examples coming with netcat, I gather the server needs to use the -p option, as in

nc -u -l -p 8080

Are you sure you need UDP? You should have better quality without the "-u".

Suppose the two computers have IP addresses 192.168.1.9 (server) and 192.168.1.8 (client), then the commands would be, on the server:

nc -u -l -p 8080 | aplay -t raw -c 2 -f S16_LE -r 48000

and on the client:

arecord -t raw -c 2 -f S16_LE -r 48000 | nc -u 192.168.1.9 8080
16
  • I want it to be fast, that’s why I opted for udp.
    – nmd_07
    Dec 7 '20 at 21:32
  • Does it work now? Dec 8 '20 at 1:59
  • It did not work.
    – nmd_07
    Dec 8 '20 at 16:22
  • You need to start the server first. Dec 8 '20 at 17:28
  • I did, it doesn't work. Did you try doing it yourself?
    – nmd_07
    Dec 8 '20 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.