B4J Question How can I stream audio from PC1 to PC2, which are geographically distant?

amorosik

Expert
Licensed User
I have PC1 in Italy and PC2 in France
Both PC1 and PC2 are connected to the internet with a standard subscription that provides a dynamic external IP address
How can I listen to the audio transmitted by the sound card on PC2 exactly as it is played on PC1?
Basically, I'm in front of PC2 and I'd like to hear what PC1 outputs on the sound card
How can I do this, given that both PCs have a dynamic external IP address?
 

aminoacid

Active Member
Licensed User
Longtime User
I have PC1 in Italy and PC2 in France
Both PC1 and PC2 are connected to the internet with a standard subscription that provides a dynamic external IP address
How can I listen to the audio transmitted by the sound card on PC2 exactly as it is played on PC1?
Basically, I'm in front of PC2 and I'd like to hear what PC1 outputs on the sound card
How can I do this, given that both PCs have a dynamic external IP address?

Basically if your Internet Service provider allows inbound Ports to be opened then the solution is very easy and does not even require B4J. This is something that I have done in less than an hour. You can use DDNS to map your dynamic IP addresses to hostnames, however some ISPs block inbound port access. So the first thing is to try TCP communications between the two computers using something like "PortPeeker".

Once you have established that TCP communiations is possible between the two then all you have to do it run a program like MediaMtx (available in Linux and Windows versions) and stream audio and video from one to another.

Alternatively, if you have inbound port restrictions, you can rent a VPS for about $5 to $10 /month and run mediamtx on the VPS as a "server" with each computer connecting to the VPS to publish and subscribe to the stream.
 
Upvote 0
Top