The whistle/horn and diesel sound/choof choof etc comes from the loco itself.
It requires a "sound decoder", which is a little circuit board that goes inside the loco itself. The DCC console/controller sends computer signals along the tracks which are picked up by the circuit board in the loco. For sound, this little circuit board also has a little speaker attached to it.
i.e. you configure, using the controller, the little circuit board inside the loco, to say it is "loco number 21" or whatever number, and when you press the buttons on the controller, it sends a computer signal along the tracks to, say, "loco number 21 + whistle", and the speaker inside the loco will TOOOOOT!!. Or, the controller sends a computer signal along the tracks to "loco number 21 + turn headlight on", or "loco number 21 + increase speed 1 notch" or "loco number 21 + go in reverse", or "loco number 21 + turn engine sound on", etc etc etc.
get the idea?