Now you have understand my problem. I have windows 7 but the problem is that there's only one device "speakers and headphones" normally it gives sound in speakers when there's no headphones and when there is the sound is coming from them. When the steam community is on nothing in settings of windows seems to change but the sounds starts to come from both speakers and headphones. So I believe it's connected in steam voice settings but I have no idea how to fix it.
Okay, go to steam settings then click on voice tab then change device and see if that works.
This is the only way i know of changing audio device on steam.
If not, this may sound simple but can't you just turn your speakers off when you have headphones plugged in?