I can't do something like /playsound random.explode @a ~ ~ ~
it will just play the sound to everyone, no matter how far away they are.
But when I use a command like/playsound random.explode @a 10 25 -4
it will play the sound coming from the coords specified.
Please note: I do not know how many versions of Minecraft this concerns, but I discovered it in 14w11b. Also, I do not know if this is a bug or if it is just not implemented. If it is not a bug, I would appreciate it if this was added to the game.
Consider the command you are typing in.
@a ~ ~ ~
Play to everyone relative to their coordinates. So it will play everywhere there is a player.
@a x y z
Play to everyone at these specific coordinates. If too far away you won't hear.
Try either @p to specify a specific player or use /execute @p ~ ~ ~ /playsound @a[r=50] to execute the command at a player's location limiting to a radius of 50 in this case.