As others have said, you will need something between your 4V speaker output and the 12V relay. Not only will the speaker drive most likely not be capable of enough current, it's also not enough voltage.
Another problem is that you can't rely on whether the speaker output is normally high or normally low. It's quite possible this is a small speaker tied between the 5V supply and a low side switch. In addition it is pulsed, but you want to keep the relay on the whole time during a tone (as I understand it).
Here is a circuit that should reliably deal with all these issues. These are all common, cheap, and off the shelf parts. The diode can be any small signal switching type, like the common 1N4148 shown, but many others will do. All three could be Schottky diodes too.
![](https://cdn.statically.io/img/i.sstatic.net/kRz8g.gif)
The input is capacitively coupled, so its DC level doesn't matter and it can idle high or low. C1, D1, D2, and C2 form a charge pump that makes a voltage on the left side of R1 when the inupt is actively wiggled. That voltage causes a current thru R1, which turns on the transistor. There is enough charge storage in C2 to keep the transistor on for a little while. As long as the input is pulsed fast enough, the transistor will stay on. The transistor is then a low side switch turning on the relay between it and the 12V supply in your computer. D3 may look like it doesn't do anything, but it's important and leaving it out will eventually fry Q1 and the circuit will no longer work. The relay coil has considerable inductance, so current thru it can't be interrupted instantaneously. D3 provides a safe place for this current to go until it ramps down on its own. Without it, the inductor will create whatever voltage it needs to keep the current going, which will damage Q1.
This circuit should be good enough to drive small 12V relays that require around 50 mA to drive. I showed 5 kHz example tone frequency. Higher is better, since it allows the charge pump to deliver more current into the base of Q1. If you can tell the PC to make 10 kHz out, do that.